Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am merging all my Class Library Projects (ex: LibA.dll, LibB.dll, Sri.Theme.dll) into a single DLL (TestFrame.dll) using ILRepack. I am able to merge all the C# code and also able to access c# logic where ever I use consolidated DLL (TestFrame.dll). But the problem is I have one class library (Sri.Theme.dll) which has WPF Resource-dictionaries, I am not able to call these Resource-dictionaries in my WPF project App.xaml. I have checked TestFrame.dll in ILSpy, these Resource Dictionaries are merged into it. It is giving below error message:

Cannot locate resource 'styles/bootstrap.xaml'.

Sri.Theme project structure will be like this:



Styles
Themes

What I have tried:

I am trying like this in App.xaml in WpfApp1

Try1: <ResourceDictionary Source="pack://application:,,,/TestFrame;component/Styles/Bootstrap.xaml"/>

Try2: <ResourceDictionary Source="pack://application:,,,/Sri.Theme;component/Styles/Bootstrap.xaml"/>

Try3: <ResourceDictionary Source="pack://application:,,,/TestFrame;component/Sri.Theme/Styles/Bootstrap.xaml"/>

Can anyone please help me with this. Excuse for my bad language
Posted
Updated 31-Mar-21 23:36pm
Comments
[no name] 30-Mar-21 11:36am    
Maybe ask yourself why you're "merging" in the first place; particularly for those cases where it doesn't work, and you have a choice.

1 solution

I don't need to use pack. I do it this way:
C#
<ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
        <MyAssemblyName;component/ResourceDicts/MyResourceDictionary.xaml" />
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900