I have not had any luck merging wpf assemblies using ILMerge.
3 Answers
I would imagine that the main issue you are having when merging WPF assemblies is that the PackURIs for resources are not being changed.
If you are able to refactor your resources to a single assembly that is not merged or otherwise fix up the PackURI's in your assemblies then your merged assemblies should work.

- 6,338
- 1
- 23
- 18
Mike Barnett's ILMerge page at http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx refers to this note from Jeffrey Richter:
This section discusses how to embed your application’s dependent DLLs inside your EXE file, simplifying deployment by allowing you to distribute just one physical file.
In essence you bundle your dependent DLLs as resources into your EXE and load on demand by hooking your AppDomain’s ResolveAssembly
event.

- 24,842
- 10
- 63
- 95
I don´t know why ILMerge has a problem with WPF Assemblies, but there is another tool to pack and merge assemblies. Take a look at .NETZ.

- 34,674
- 10
- 123
- 155
-
I tried out .NETZ but unfortunately it doesn't seem to work with my .NET 4 WPF app. I'm using it just to merge assemblies (not compress them) but the built app just throws an exception when run. – devios1 Aug 02 '10 at 11:51
-
Just a heads up to anyone out there thinking they should try it with 3.5 WPF.. I tried .NETZ on a 3.5 WPF app and it reports it "Cannot determine EXE's subsystem (default is GUI windows EXE) The packed application will fail!". – Adam Caviness May 29 '12 at 19:10