views:

134

answers:

3

Hi,

I've created a Windows Forms Application in Visual Studio 2008, .NET 3.5. Now I want to finalize my project, i.e. to create a single .exe file which I can give to someone and he will be able to run it on his computer.

In my project files I found bin/Debug directory where I see a .exe file. Can I just use this file as is, or I am missing some important finalizing procedure ?

Thanks !

+6  A: 

You can just take the EXE as long as it has no dependencies. If there are any dll files in there, you need to include them (or use the ILMerge command line utility to combine them). You can, however, ignore any generated pdb or xml files.

As a side note, you should be compiling in release if you plan on deploying your project (the output will be in bin/Release)

Richard Szalay
Thank you for your answer ! I still cannot figure out how to compile in Release mode. I right clicked my project -> Properties -> Build, changed the Configuration to Release and Rebuilt the Solution. However, I don't see bin/Release created (there is only Debug dir inside bin). Moreover, if I close the Properties tab, and reopen it, the Configuration is changed to Debug. Why ?
Check the top of your Visual Studio menu. You have a combobox there to switch between both modes. What you did was looking at the _configuration_ of the release mode only.
Benjamin Podszun
Great, Thanks a lot !
+1  A: 

You are not clear in you question. If your solutions output is just a single exe file, then Yes, you can give away the exe file in bin\debug.

But instead of bin\debug\ exe you must distribute the bin\Release\ exe which is meant for release purpose.

claws
A: 

To make the ILMerge easier, use the GUI tool from codeplex at http://ilmergegui.codeplex.com/

If this is a commercial application, several commercial obfuscators allow creating a single exe.

SetiSeeker