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

Wil picture Wil · Jun 3, 2010 · Viewed 149.4k times · Source

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!

Answer

Dean Harding picture Dean Harding · Jun 3, 2010

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).