I really hit my head against the wall here. Firstly, some background. The application is a PRISM 4 / MVVM application using WPF, and my solution is structured as follows:
MyCompany.MyProduct (MyCompany.MyProduct.exe) +-- Shell.xaml Shell.xaml.cs app.config (etc) MyCompany.MyProduct.Infrastructure (MyCompany.MyProduct.Infrastructure.dll) +-- Resources | +-- MyApplicationStyles.xaml | SuperCoolImage.png | (etc) +-- BaseClasses +-- ViewModelBase.cs (etc) MyCompany.MyProduct.Modules.ModuleA (MyCompany.MyProduct.Modules.ModuleA.dll) +-- ViewModels | +-- StuffViewModel.cs | (etc) +-- Views +-- StuffView.xaml StuffView.xaml.cs (etc)
Links to projects:
- Links to MyCompany.MyProduct MyCompany.MyProduct.Infrastructure
- MyCompany.MyProduct.Modules.ModuleA Recommendations MyCompany.MyProduct.Infrastructure
Now, in both Shell.xaml and StuffView.xaml, I include a federated dictionary as such:
<ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/MyCompany.MyProduct.Infrastructure;component/Resources/MyApplicationStyles.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary>
In both cases, however, I run head-first with the following error:
Could not load file or assembly 'MyCompany.MyProduct.Infrastructure, Culture=neutral' or one of its dependencies. The system cannot find the file specified.
(sigh) I also noticed that the xaml editor shows me two squiggly errors on this line:
<ResourceDictionary Source="pack://application:,,,/MyCompany.MyProduct.Infrastructure;component/Resources/MyApplicationStyles.xaml"/>
First squiggly error ...
An error occurred while finding the resource dictionary "pack://application:,,,/MyCompany.MyProduct.Infrastrucuture;component/Resources/MyApplicationStyles.xaml".
The second (more curious) short mistake ...
"Assembly name expected instead of project name."
So here is what I tried:
- I checked three times that the project links exist (and I deleted and added them again)
- I checked that MyCompany.MyProduct.Infrastructure works successfully
- I double checked that the assembly is correct (via AssemblyInfo.cs)
- I changed the build action to MyApplicationStyles.xaml again and again (it is currently set to "Page")
- I manually cleared the solution and rebuilt
- I restarted Visual Studio several times
- I sacrificed a goat (all right ... he was a very unfriendly goat)
I have no ideas, and the search is very few. Any ideas?