Static Linking C# .net

A

ashesman

OK, I have written an application in MS Visual C# using .net. Is it
posibble to static link into one self contained .exe file? This would
certainly make distribution of a small accessory file much easier. And
allow it to be easily packaged and installed with our other applications
built in an old C++ builder. If static linking is possible, how to do
it in Visual Studio?
 
J

Jon Skeet [C# MVP]

ashesman said:
OK, I have written an application in MS Visual C# using .net. Is it
posibble to static link into one self contained .exe file? This would
certainly make distribution of a small accessory file much easier. And
allow it to be easily packaged and installed with our other applications
built in an old C++ builder. If static linking is possible, how to do
it in Visual Studio?

You can merge multiple assemblies together with ILMerge, but you'd
still need the .NET framework to be installed. There are a few ways
round that, although none are very widely used as far as I'm aware:
http://www.pobox.com/~skeet/csharp/faq/#framework.required
 
C

Chris Mullins

ashesman said:
OK, I have written an application in MS Visual C# using .net. Is it
posibble to static link into one self contained .exe file? This would
certainly make distribution of a small accessory file much easier. And
allow it to be easily packaged and installed with our other applications
built in an old C++ builder. If static linking is possible, how to do
it in Visual Studio?

It depends on what you mean by static linking. If by this you mean, "Run on
a system that doesn't have .Net installed", you can use the remotesoft stuff
to do it:
http://www.remotesoft.com/

We deploy our install applications this way, so that the installer will
"just run" on a machine, regardless of pretty much anything else.

We've also deployed some .NET WinForms applications this way. The client
said, "You can't use .Net 2.0. We're not installing that on our 10,000 old
Win98 machines." to which we responded, "here's the client.exe, it should
run just fine.".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top