0

According to http://blogs.msdn.com/b/junfeng/archive/2005/02/12/371683.aspx I should be able to create a single .exe file build from some source code and a .netmodule file. However, after looking at http://msdn.microsoft.com/en-us/library/92b5ab4h.aspx and http://msdn.microsoft.com/en-us/library/k669k83h.aspx I cannot seem to make this happen. Whenever I run my .exe it is looking for the .netmodule externally.

Does anyone know of any example showing which options I have to pass to csc to make this do what I want?

For example I have, common.netmodule and program.cs, and I want a single file program.exe that has common.netmodule in the assembly.

Eric Kolotyluk
  • 1,958
  • 2
  • 21
  • 30
  • Well, I tried installing the .Net 2.0 SDK, since the first article claims the version of link.exe in that will do what I want, but the setup.exe fails to run. I have tried various compatibility modes, but they all seem to fail. None of the Microsoft documentation I have found explicitly says I cannot do what I want, nor does it say I can. Why does Microsoft give you the features you want in early versions of products, then silently remove them later? – Eric Kolotyluk Apr 09 '14 at 19:09
  • I am getting closer to what I want using al.exe. I am able to combine my modules together and produce a .exe file, but it needs to run with elevated permissions, and I cannot find any way to get my app.manifest into the .exe assembly. http://msdn.microsoft.com/en-us/library/c405shex%28v=vs.110%29.aspx The Microsoft documentation is truly abstruse. – Eric Kolotyluk Apr 09 '14 at 20:28
  • I am starting to think it is just impossible to do what I want to do, the way I was hoping to do it. I was finally able to build an assembly with al and ml, but al only creates an assembly with references to the .netmodule files, it will not actually put them in the .exe assembly. – Eric Kolotyluk Apr 09 '14 at 21:03

1 Answers1

0

After rethinking things, I decided to solve the problem at the source code level. Instead of compiling a common.netmodule file, I just have Maven copy my common.cs file into the project specific directories, and then compile. It works, it's simple, and I cannot believe I wasted so much time trying to figure out the abstruse details of .Net assemblies.

Eric Kolotyluk
  • 1,958
  • 2
  • 21
  • 30