I have the Problem, when I have WPF UserControls and I have the DLL where this UserControl is located in different Versions loaded into the Assembly, the UserControl could not find it's Resources any more. (Maybe because they are there with the same Name but in different Versioned DLLs) Any know how to fix it?
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- Android version code for App updating
- XAML: Applying styles to nested controls
- Modelica libraries use different MSL version
I found a way myself, by changeing the "IntializeComponent" Method in the DLL. This Builds a URI, wich then loades the XAML. The Problem is, in the URI, the Version is not included! So I created a small App, wich I call after the compile Process, wich modifies the DLL so that the Version String it's included! For this, it's using Mono.Cecil...
Here is the code:
Similar to this: https://stackoverflow.com/a/26689750/195275
But the answer does not require changing IL code. You can pass /p:AssemblyVersion to the msbuild.
I fixed it in SharpDevelop now this way: https://github.com/icsharpcode/SharpDevelop/commit/b3ea4a0efb7e3b8e083f8be40ea6f7e03ff44604