XamlParseException:找不到名为/键为PhoneBackgroundBrush[行:47位置:111]的资源

XamlParseException:找不到名为/键为PhoneBackgroundBrush[行:47位置:111]的资源,xaml,windows-phone-8,windows-phone,visual-studio-express,xamlparseexception,Xaml,Windows Phone 8,Windows Phone,Visual Studio Express,Xamlparseexception,当我第一次开始开发时,一切都很好,但是第二次启动项目时,却出现了这个错误。因为xaml中有一个错误,所以设计布局的预览从未显示,所以我在这里盲目地工作 做了一些研究,发现这个人和我一样有问题,但我尝试了他们的解决方案,但对我不起作用,可能是因为他们使用的是Windows Phone 7.1,而我使用的是8。以下是链接: 任何帮助都将不胜感激 MainPage.xaml: <phone:PhoneApplicationPage x:Class="PetSounds.MainPage"

当我第一次开始开发时,一切都很好,但是第二次启动项目时,却出现了这个错误。因为xaml中有一个错误,所以设计布局的预览从未显示,所以我在这里盲目地工作

做了一些研究,发现这个人和我一样有问题,但我尝试了他们的解决方案,但对我不起作用,可能是因为他们使用的是Windows Phone 7.1,而我使用的是8。以下是链接:

任何帮助都将不胜感激

MainPage.xaml:

<phone:PhoneApplicationPage
    x:Class="PetSounds.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
            <TextBlock Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Button Name="PlayAudioButton"
                    Height="200"
                    Width="200"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Top"
                    Background="Red"
                    Click="PlayAudioButton_Click_1">Quack</Button>
            <MediaElement x:Name="QuackMediaElement"
                          Source="/Assets/Audio/Animals/Duck.wav"
                          Volume="1"
                          AutoPlay="False"
                          />
        </Grid>
    </Grid>

</phone:PhoneApplicationPage> 

江湖郎中
编辑

以下是App.Xaml文件:

<Application
    x:Class="PetSounds.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">

    <!--Application Resources-->
    <Application.Resources>
        <local:LocalizedStrings xmlns:local="clr-namespace:PetSounds" x:Key="LocalizedStrings"/>
    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService
            Launching="Application_Launching" Closing="Application_Closing"
            Activated="Application_Activated" Deactivated="Application_Deactivated"/>
    </Application.ApplicationLifetimeObjects>

</Application>


如果需要,请告诉我,我将发布其他文件。

如果您使用“PhoneBackgroundBrush”键进行搜索(CTRL+SHIFT+F),您在项目中找到了吗?您是否为此项目中的UI元素创建了自定义样式(例如按钮控件的样式)?尝试在App.xaml文件中搜索PhoneBackgroundBrush。请与我们共享你的App.xaml代码。该文件中可能有错误。我搜索过,但它不存在@MiiiteWhat's at
行:47位置:111