tags:

views:

52

answers:

1

Hello. I am trying to merge two files. One of them is .net3.5 wpf application and other is WPF notify icon dll

i use the following command:

IlMerge /target:winexe /out:PS.exe "PlayerSearcher.exe" "Hardcodet.Wpf.TaskbarNotification.dll"

But when i launch result assebmly my application is crashed with this error

EventType : clr20r3 P1 : ps.exe
P2 : 1.0.0.0 P3 : 4c0ee52f P4 : presentationframework P5 : 3.0.0.0 P6 : 4938d608 P7 : 9a1 P8 : 46 P9 : system.io.ioexception

Why? And how i can to build a single file application?

+1  A: 

Just a guess, but you might need to merge additional references. For example, maybe you also had somethingelse.dll copied into the project's bin folder along with the EXE and forgot to include it?

You shouldn't need to merge .NET Framework assemblies from the GAC though, unless there's an issue around the "Copy Local" True/false setting:

Now, the project you modified will automatically have all referenced assemblies merged-in. Only the assemblies marked "Copy Local" will be merged so system assemblies and GAC assemblies won't be merged by default.

-- http://blogs.msdn.com/b/jomo_fisher/archive/2006/03/05/544144.aspx

Maybe, just to debug it, try copying the .NET Framework classes locally into your project and merge them also to see if that works. This might help begin to isolate the error.

John K
But which classes i must to copy? PresentationCore, WindowsBase etc?
Neir0
It's not classes but assemblies you need to use. I'd suggest to look at the references node in VS or the dialog and set all references to Copy Local, and then use MSIL on the entire bin folder of your assemblies. This article provides some guidance for how to manage the assemblies: http://msdn.microsoft.com/en-us/library/wkze6zky(VS.80).aspx
John K