The resource “x” could not be resolved.

后端 未结 7 2035
暖寄归人
暖寄归人 2021-02-15 16:40

I have recently upgraded to VS 2012, I had to as I needed to start using the .net 4.5 but that is besides the point. My problem is the following:

I have a Resource

7条回答
  •  一向
    一向 (楼主)
    2021-02-15 17:35

    WPF is unable to resolve the resource dictionary that you are trying to merge. When you create a merged dictionary, WPF follows a set of rules to attempt to resolve the URI. In your case, the URI is ambiguous, so WPF is unable to reliably resolve it.

    Change the Source URI in the App.xaml to an absolute pack URI. For example, if you project is called MyProject (i.e.: "MyProject" is the short assembly name), then you should change the Source in App.xaml to:

       
    

    This assumes AppStyles.xaml is in the root of MyProject. You can optionally specify the authority, assembly version and public key information of the signed assembly. However, you should be safe with the short assembly name (MyProject, in the above example).

    See this page on MSDN for further details on Pack URIs in WPF: http://msdn.microsoft.com/en-us/library/aa970069(v=vs.110).aspx

提交回复
热议问题