I'm really beating my head against the wall here. First, some background. The app is a PRISM 4/MVVM app 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)
Project References:
- MyCompany.MyProduct references MyCompany.MyProduct.Infrastructure
- MyCompany.MyProduct.Modules.ModuleA references MyCompany.MyProduct.Infrastructure
Now, In both Shell.xaml and StuffView.xaml, I include a merged 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'm running head-first into 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 notice that the xaml editor is showing me two squiggly errors on this line:
<ResourceDictionary Source="pack://application:,,,/MyCompany.MyProduct.Infrastructure;component/Resources/MyApplicationStyles.xaml"/>
The first squiggly error is...
An error occurred while finding the resource dictionary "pack://application:,,,/MyCompany.MyProduct.Infrastrucuture;component/Resources/MyApplicationStyles.xaml".
The second (an more curious) squiggly error is...
"Assembly name expected instead of project name."
So here's what I've tried:
- I've triple-checked that the project references exist (and I've removed and re-added them)
- I've checked that MyCompany.MyProduct.Infrastructure builds successfully
- I've double-checked that the assembly is correct (via AssemblyInfo.cs)
- I've changed the Build Action on MyApplicationStyles.xaml time and again (it's currently set to "Page")
- I've manually cleaned the solution and rebuilt
- I've re-started Visual Studio a couple of times
- I've sacrificed a goat (it's okay... he was a really unfriendly goat)
I'm out of ideas and searching is turning up very little. Any ideas?