I am looking for the solution for merging multiple dlls into a single dll for a wpf application. Is there an utility or some way to do this?
I already checked with ilmerge and costura fody where ilmerge don't support wpf dlls and costura embed dlls into an exe not into dll.
Related
Using Visual Studio Installer, I created the .msi file for the WPF project and the class library for the custom action. Everything works fine, but there are many dll assembly files associated with the project in C:\Program Files (x86)\Publisher\Program.
I applied Fody.Costura to WPF project after researching when building the WPF project. Therefore, it is working properly in the release/debug folder of the WPF project. When I tried adding a WPF project with 'project out...' to Visual Studio Installer, regardless of Fody.Costura, dlls appeared. On the client-side, there are still dlls. Can they be hidden under the program files folder?
FYI. WPF project is built on .NET Framework 4.8.
I found a way to hide dll files using the Hidden property. By setting this property to 'True', DLL files become hidden but still exist. If you have other ways, feel free to leave your comment.
I'm writing a SolidWorks addin, where I can host WPF only within an Winforms Elementhost. Now I want to use a Flyout from Mahapps.Metro, which depens on being hosted in a MetroWindow. Is there any way I can use the Flyout from within a WPF Usercontrol? I'm using .NET 4.6.2, Mahapps.Metro 1.6 and SolidWorks 2018.
Looks like the Information I found here and here is obsolete. I just installed the NuGet Packages Mahapps.Metro and Mahapps.Metro.Iconpacks and everything is working as expected.
If someone is trying to do it in a SolidWorks Addin too, make sure to manually load a new version of System.Windows.Interactivity, because Solid is loading an old version from the application base directory, which is not compatible with Mahapps.Metro!
Be very careful when you are working with .NET add-ins for solidworks. If your application uses some third-party UI lib, you need to copy those referenced assemblies to the host application (sldworks.exe) directory. For some reason, the domain application is that of hosting exe and not the dll. CLR will look for references in the sldworks.exe's directory and it doesn't find, the application throw some nasty exception that will crash your SOLIDWORKS.
We have a VS2012 solution that contains two class library projects, one that produces a Silverlight DLL and one a standard .NET DLL. The class files are shared ("Add as Link") between the two projects.
The upshot is that they both contain a WPF/Silverlight control that inherits from Canvas that we then use within Silverlight and WPF applications.
We are now looking at using the same component within an app to be used on a Microsoft Surface RT. How do I go about building a DLL that can be used like this?
There's no reason you couldn't do it the same way, you are already doing it if WPF and Silverlight: just create a Class Library (Windows Store apps) project and add existing class files as links to it as well.
You can use conditional compilation symbol NETFX_CORE when you need different code for Windows Store apps:
#if NETFX_CORE
// Windows Store specific code
#endif
I am developing application for WPF and Silverlight by ProjectLinker with PRISM and MEF modularity.
My modules are Class Library (in WPF) and Silverlight Class Library (in Silverlight).
Now I want to load modules in WPF or Silverlight by Catalog.xaml from server.
Problem is:
- Silverlight cannot load DLL but only XAP
- WPF cannot load XAP but only DLL
How can I do that - developing by project linker (same code for both platforms), create modules, download from server and load to application?
I have in bootstrapper:
On server WCF I have Catalog.xaml - I download it and...
catalog = Microsoft.Practices.Prism.Modularity.ModuleCatalog.CreateFromXaml(stream); - it works
But If I run application by the load module I have an error (I tried to load DLL to Silverlight).
Thanks
Try this link from the PRISM website: Sharing Code Between Silverlight and WPF
For the Module catalogs, you will either need to create separate XAML files, or use possibly use TT files to generate them from a common set of module names.
As you need to carefully specify the dependencies for Silverlight to get the best start times, you might be better off maintaining separate files.
Problem was on type of project. Project for silverlight must be as Silverlight application. So I changed type of silverlight project and now build for WPF is DLL and for silverlight is XAP. It is working.
I have resources in separate assemblies to be used by multiple WPF apps and this is working fine. Now I am creating a Silverlight 3 app and am trying to use the same assembly to get the same resources. I get an error at the time of adding a reference, saying only Silverlight assemblies can be referenced.
What's the best way for me to do this? Must I have 2 separate sets of assemblies for resources - one for WPF and one for Silverlight? I would not like to maintain two distinct but identical resource assemblies...
Thanks
Note: "link-adding" a file resolved the issue of sharing the same xaml across multiple assemblies. However, to me, one major drawback is that this feature is not supported in Blend 3! Blend keeps trying to find the file locally in the project tree.
Unfortunately, .NET assemblies cannot be referenced from a Silverlight app.
For details and possible solutions, see http://www.pagebrooks.com/archive/2008/10/11/sharing-code-between-.net-and-silverlight-platforms.aspx.
Can you store the resources externally and then use a pre-build step to copy the files into a silverlight assembly that you reference in your project? That was you can avoid having duplicate assemblies and just change the resources in a single location.