I have 2 projects under the same solution in VS2010. P1 references P2 as a project.
P1 contains a UserControl
from P2 and this UserControl
references many dictionaries and converters from P2 itself. Separately, these 2 projects runs well without issues.
The problem is when P1 calls the UserControl
from P2, an exception pops out stating that it cannot find the resource key which is needed for the UserControl.
Can someone point me in the right direction?
EDIT:
This is the referencing (I had stripped all non-relevant data):
This is P1's App.xaml:
<Application x:Class="P1.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml" >
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Dictionaries/TabControlDictionary.xaml"/>
<ResourceDictionary Source="/Dictionaries/ButtonDictionary.xaml"/>
and so on....
</Close Everything>
This is P2's App.xaml:
<Application x:Class="P2.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml" >
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Dictionaries/ListBox1Dictionary.xaml"/>
<ResourceDictionary Source="/Dictionaries/ListBox2Dictionary.xaml"/>
and so on....
</Close Everything>
And this is where P1 creates the UserControl:
<Window xmlns:p2="clr-namespace:P2;assembly=P2"
and other stuff >
<Grid>
<p2:myUserControl />
</Close Everything>
Which threw an exception during runtime saying it can't find resource keys. I should also point out that P1 and P2 are in completely different folder and drives on the HDD.