C# 在Universal platform中访问资源字典时发生异常

C# 在Universal platform中访问资源字典时发生异常,c#,universal,C#,Universal,在我的项目中,我正在设置工具提示模板,在generic.xaml文件中使用以下代码 <DataTemplate x:Key="PART_TooltipTemplate"> <Border BorderThickness="1" Background="LightYellow" BorderBrush="Black"> <TextBlock Text="{Binding Pa

在我的项目中,我正在设置工具提示模板,在generic.xaml文件中使用以下代码

<DataTemplate x:Key="PART_TooltipTemplate">
        <Border BorderThickness="1"
                Background="LightYellow"
               BorderBrush="Black">
        <TextBlock Text="{Binding Path=Tooltip}" 
                   FontSize="12"
                   Foreground="Black"
                   Padding="2"/>
    </Border>
</DataTemplate>
在访问它时,我得到以下异常 发生“System.Runtime.InteropServices.COMException”类型的异常,但未在用户代码中处理

其他信息:调用COM组件时返回错误HRESULT E_FAIL。“

那么我该如何解决这个问题呢

提前感谢:)

ResourceDictionary rd = new ResourceDictionary(){Source = new Uri("ms-appx:///Themes/Generic.xaml", UriKind.RelativeOrAbsolute)};