Unmanaged C# application

  • Thread starter Thread starter mrTriffid
  • Start date Start date
M

mrTriffid

Hi,
Very simple question (I hope...)- Can I create a C# application that
will run *without* having to deploy the .Net framework on the chosen
machine?

Despite excessive Googling of the web and Usenet, I can't get a
definitive answer to this; it seems reasonably clear that it isn't
possible under VS.Net 2002, but I remember reading something that
implied it should be possible under the 2003 release. Is this true;
and more importantly, can it be done in a reasonably straightforward
manner?

Apologies if this is blatantly simple, but I'm a complete newbie when
it comes to VS/C#. Any help appreciated... :-)
 
No - C# code is compiled to MSIL which requires the .NET Framework. There is
no way to produce unmanaged applications with C# (or VB.NET etc.)

This isn't going to be much of a problem in the long run as the framework
becomes more ubiquitous (IIRC it's already shipped as standard with Windows
Server 2003 and future versions of Windows, namely Longhorn, are tied to the
framework)
 
It can be done, but with 3rd party tools. Currently,
VS.NET does not seem to support it.

I have successfully compiled some windows forms app into
x86 native code. For example, the Scribble sample
distributed with VS.NET, becomes about 5.5MB (3MB when
zipped) after natively compiled. This file contains all
the libraries, and the program can run w/o .net
framework. The file size can be further reduced when
better optimization is performed later on.

I will post the sample code and more info into our
website soon, http://www.remotesoft.com

If you just simply want to wrap up a package which can be
distributed to machines that do not have .net framework
installed, you can use our Salamander Linker and
Minideployment tool:

http://www.remotesoft.com/linker

Hope this is helpful,

Huihong
Remotesoft, Inc.
 
Thanks for the info on this. I'll steer clear of any attempts to run
this as native code, as my knowledge of Windows and .Net is pretty
limited and I'd guess that even with a good third-party compiler, a
decent level of knowledge would be required to do this.
 
Back
Top