Problem loading resources from referenced assembly in Expression Blend

I have a problem loading resources for UserControl from a reference assembly in Expression Blend

Here is the relevant code:

<UserControl.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/Referenced.Assembly;component/Resources/ResourceDictionary.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </UserControl.Resources> 

I also tried this URI option:

 <ResourceDictionary Source="/Referenced.Assembly;Component/Resources/ResourceDictionary.xaml"/> 

In Visual Studio 2008 SP1 (both for code and for the designer) everything works fine, and the application uses the specified resources. When you download the solution and open the UserControl XAML file in Expression Blend 3, it says: β€œThe specified file was not found” (or, like me, I have a localized version of the .NET Framework), no other information, no exceptions arise when debugging the process Blend in Visual Studio.

Any ideas?

+4
source share
1 answer

OK, after some digging, I found a problem. You will have this problem, do not forget to add this code to your .csproj file:

 <ProjectTypeGuids> {60dc8134-eba5-43b8-bcc9-bb4bc16c2548}; {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} </ProjectTypeGuids> 

Even easier to solve this problem is to create a new project and select the WPF User Control Library template instead of the Class Library .

+2
source

Source: https://habr.com/ru/post/1300984/


All Articles