Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile to stand alone exe for C# app in Visual Studio 2010

Similar to this question Compile to a stand-alone executable (.exe) in Visual Studio

But nothing there works for me.

I've written an app that is very simple in C#. I want this to compile to a stand alone exe file, but I can't seem to find the proper settings to do this. Everything compiles into a publish folder and there is only the setup/install files.

Thanks!

like image 514
Wil Avatar asked Jun 03 '10 01:06

Wil


People also ask

Does C compile to EXE?

The C file is compiled into an executable (EXE) file named "filename.exe."

Can EXE file run independently?

2.An EXE file can be run independently while a DLL is used by other applications. 3. A DLL file can be reused by other applications while an EXE cannot.


1 Answers

You just compile it. In the bin\Release (or bin\Debug) folder, the .exe will be in there.

If you're asking how to make an executable which does not rely on the .NET framework at all, then that's a lot harder and you'll need to purchase something like RemoteSoft's Salamader. In general, it's not really worth the bother: Windows Vista comes with .NET framework 2.0 pre-installed already so if you're worried about that, you can just target the 2.0 framework (then only XP users would have to install the framework).

like image 168
Dean Harding Avatar answered Sep 21 '22 21:09

Dean Harding