-1

Okay, so I finished a .net program and I want it to be able to be distributed to those who don't have the .net framework / latest edition and to make it portable. I'm using the ILMerge Gui (http://ilmergegui.codeplex.com) but every time I add all the required .net DLLs and attempt to merge them it comes up with an error message saying:

"There was a problem trying to merge. The output assembly might not work as expected. ILMerge.Merge: The assembly 'mscorlib' was not merged in correctly. It is still listed as an external reference in the target assembly."

I have "Copy Attributes" and "Union Duplicates" checked and .net 4.0 set as the framework.

What is going wrong?

Chris Altig
  • 680
  • 3
  • 8
  • 22
  • The purpose of ILMerge is not to create a fully self contained .NET framework executable. If it was, just adding mscorlib would not be sufficient anyway. – Christian.K Aug 01 '13 at 07:32
  • I have never used ILMerge, but the page seems to imply that the program is only useful for merging .NET assemblies. Even though it is one of the main DLL files of the framework, `mscorlib.dll` is not a .NET assembly. – Theodoros Chatzigiannakis Aug 01 '13 at 07:33
  • 1
    @TheodorosChatzigiannakis: `mscorlib` **is** a .NET assembly. – Dennis Aug 01 '13 at 07:36
  • This message can often be resolved by adding /closed as parameter. But I doubt like the others that you can merge the entire .NET framework into a single executable. – Hanno Aug 01 '13 at 07:39
  • @Dennis Ah, yes, you're right. I somehow thought he was referring to the CLR engine. I think it's `mscoree.dll`...? – Theodoros Chatzigiannakis Aug 01 '13 at 07:50
  • @TheodorosChatzigiannakis: yes, you probably confused it with `MSCOREE`. – Dennis Aug 01 '13 at 07:53
  • Related: http://stackoverflow.com/questions/45702/is-there-some-way-to-compile-a-net-application-to-native-code – Caramiriel Feb 25 '15 at 07:01

1 Answers1

1

I want it to be able to be distributed to those who don't have the .net framework

If you want to distribute any application to those, who don't have the .NET framework, just don't use .NET framework to make your application.

IL Merge is not for making .NET application free from .NET runtime. Event if you could merge all what you want into single assembly, this assembly won't execute without runtime.

Dennis
  • 37,026
  • 10
  • 82
  • 150