question

DangDKhanh-2637 avatar image
0 Votes"
DangDKhanh-2637 asked HuiLiu-MSFT commented

Wpf Resource Merge question!

Hi, I'm having trouble using the resource dictionary on the client machine.
after building a basic Wpf form (just a few textboxes and buttons) , this form works fine on my personal computer.

However if I deploy it on the client I get an error like the image below:

        <ResourceDictionary>
              <ResourceDictionary.MergedDictionaries>
                  <ResourceDictionary Source="Library.theme.XP;component/Themes/System.Windows.xaml"/>
                  <ResourceDictionary Source="Library.theme.XP;component/Themes/Library.Windows.Controls.xaml"/>
              </ResourceDictionary.MergedDictionaries>
          </ResourceDictionary>


136128-image.png



I put these codes inside my form.xaml without implementing any templates.
After the form is displayed the button will apply the theme

On the client I have deployed MainAssembly.dll and Library.theme.XP.dll in the same folder but it still won't load.

Where did I go wrong? (Please let me know if anything is unclear. )

Thank you!

dotnet-csharpwindows-wpf
image.png (4.7 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Does it work on your personal computer even with ":ibrary"?

1 Vote 1 ·

When providing source code in a question it is very helpful for those that want to help you when you provide the source code as text instead of as an image. In this case however the problem is obvious, as Viorel-1 indicates.

0 Votes 0 ·

Hi @Viorel-1 ,@SimpleSamples
It was a typo in my post when I pressed Shift+L -> Shift+; (Library -> :ibrary).
My code run normal on my pc.

Do I need to attach xaml in my exe deployment on client?

I think it could also be a relative path error at code Source="Library.theme.XP;.."
Is there a way to check this?

Thank you!

0 Votes 0 ·

Hi,@DangDKhanh-2637. I agree with you. It may be a resource path problem and a resource problem. You could try to add resources and correct the path. For path issues, please refer to the link : https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.0/aa970069(v=vs.85)?redirectedfrom=MSDN .

1 Vote 1 ·

0 Answers