几天前发生此错误,并且似乎消失了。现在它不会消失。我还收到一个Adcontrol错误:使用此控件之前需要设置ApplicationId和AdUnitId在另一个应用程序中完全按照相同的方式设置Adcontrol,所以我看不到问题所在,也找不到任何信息。

编辑:
如果我用双括号}}删除了部分代码,则无效错误消失了。我也一起删除了Adcontrol,以隔离错误。但是,当我运行该应用程序时,仍然得到以下信息:

**A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll

    Additional information: Could not load file or assembly 'Microsoft.Phone.Controls.Toolkit.resources, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.**


我已经卸载并重新安装了WPToolkit。我在另一个应用程序中使用了类似的代码和WPToolkit,它没有给我这个错误。我还可以做些什么?

XAML无效:

<DataTemplate x:Key="SoundTileDataTemplate">
    <StackPanel>
        <Grid Margin="0,5,6,0" Height="100" Width="140"
              toolkit:TiltEffect.IsTiltEnabled="True">
            <Border BorderBrush="#FF49A609" BorderThickness="1" CornerRadius="3,3,3,3" Background="{StaticResource PhoneAccentBrush}" Opacity=".6"/>
            <TextBlock Text="{Binding Title}" FontSize="19" TextWrapping="Wrap" Width="140"  FontFamily="/BBSM;component/Fonts/123Sketch.ttf#123Sketch" TextAlignment="Center" />
            <Image Source="/Assets/tiles/TRXHSBRGIcon.png" Width="30" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,6,6" Visibility="{Binding Status, Converter={StaticResource DownloadStatusToIconVisibilityConverter}}" />
            <ProgressBar Height="12" VerticalAlignment="Bottom" Padding="0" Margin="0" Foreground="{StaticResource PhoneForegroundBrush}" Value="{Binding DownloadProgress}" Visibility="{Binding Status, Converter={StaticResource DownloadStatusToProgressBarVisibilityConverter}}"/>
        </Grid>
    </StackPanel>
</DataTemplate>

<DataTemplate x:Key="ExtrasTileDataTemplate">
    <StackPanel>
        <toolkit:ContextMenuService.ContextMenu>
            <toolkit:ContextMenu IsZoomEnabled="False" >
                <toolkit:MenuItem Header="Save as Ringtone"  Command="{Binding SaveSoundAsRingtone}" CommandParameter="{Binding FilePath}" />
            </toolkit:ContextMenu>
        </toolkit:ContextMenuService.ContextMenu>
        <Grid Margin="0,5,6,0" Height="100" Width="140"
              toolkit:TiltEffect.IsTiltEnabled="True">
            <Border BorderBrush="#FF49A609" BorderThickness="1" CornerRadius="3,3,3,3" Background="{StaticResource PhoneAccentBrush}" Opacity=".6"/>
            <TextBlock Text="{Binding Title}" FontSize="19" TextWrapping="Wrap" Width="140"  FontFamily="/BBSM;component/Fonts/123Sketch.ttf#123Sketch" TextAlignment="Center" />
            <Image Source="/Assets/tiles/TRXHSBRGIcon.png" Width="30" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,6,6" Visibility="{Binding Status, Converter={StaticResource DownloadStatusToIconVisibilityConverter}}" />
            <ProgressBar Height="12" VerticalAlignment="Bottom" Padding="0" Margin="0" Foreground="{StaticResource PhoneForegroundBrush}" Value="{Binding DownloadProgress}" Visibility="{Binding Status, Converter={StaticResource DownloadStatusToProgressBarVisibilityConverter}}"/>
        </Grid>
    </StackPanel>
</DataTemplate>


Adcontrol:

<UI:AdControl ApplicationId="*********" AdUnitId="******" Width="480" IsAutoRefreshEnabled="True" Grid.Row="1" Height="80"/>


当我运行项目时,我得到以下内容。我继续进行每个操作,然后应用程序运行,但是数据透视表头都搞砸了,但应用程序似乎正常运行。

A first chance exception of type 'Microsoft.Advertising.Shared.AdException' occurred in Microsoft.Advertising.Mobile.DLL

Additional information: You can not use PubCenter IDs for testing in the emulator. If you want to test with these IDs, please deploy your application to a device. Otherwise please change your ApplicationId to "test_client" and AdUnitId to one of the supported ad types as outlined in the documentation.

A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll

Additional information: Could not load file or assembly 'Microsoft.Phone.Controls.Toolkit.resources, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

最佳答案

如果您使用的是Windows Phone工具包,则
你必须包括

 xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
xmlns:cc="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"


在您的* .xaml页面中

08-28 01:58