.NET - x86 Project - What files need to get pushed to the production machine?

What files need to get pushed to the production machine for a console app?  You'll notice the app.config file is missing.  I didn't use one in this project.

AutoEmail.application - Don't think I include.
AutoEmail.exe - Include
AutoEmail.exe.config - Not sure
AutoEmail.exe.manifest - Not sure.
AutoEmail.pdb - Not needed if I don't need to debug the deployment.
AutoEmail.vshost.application - Not sure.
AutoEmail.vshost.exe - Don't think I need it.
AutoEmail.vshost.exe.config - Don't think I need it.
AutoEmail.vshost.exe.manifest - Don't think I need it.
AutoEmail.xml - Not sure.

Obviously, if I overcompensate, and deploy all or many of these files, it will work.  My objective, however, is to deploy only what's necessary.
Who is Participating?
Jacques Bourgeois (James Burger)Connect With a Mentor PresidentCommented:
The *.vshost.* are useless. They are used only by Visual Studio, while you are executing the application from the development environment. So you can get rid of them for deployment.

The .pdb is also usually useless, it is used by the debugger. However, some programmers like to distribute the debug information in a first deployment, because when you trap errors with the .pdb included, you have a little more information, such as the line number for the lines of code in the stacktrace. However, there is a security issue doing that for some types applications, because you are basically sending your source code away with your application. Note that if the .pdb does not have the same timestamp as the .exe, it is useless anyway, it is then simply a remains of an old compilation that has nothing to do with the current .exe.

For the other files, it depends on what you did during development. They were needed at some point, but maybe they are not anymore.

How to be sure? Start from sratch. Here is what I would whenever I need to deploy an application.

Delete all those files. Do not be scared, they are all the result of a compilation, we will bring recreate them in a minute by recompiling the application.

Fire Visual Studio with you solution or your project. Go in the project properties window (bottom of the Project menu). Select the Compile tab, and then the Advanced Compile Options button. In Generate debug info, select None. This will get rid of the .pdb and make your application slightly faster and smaller. Be sure to reset it later for future development, otherwise your debugger won't work for that project.

Recompile (Build) the solution or project.

You will end up of a clean slate of the files that are needed for your project in its actual state, with only the *.vshost.* as extras. Close Visual Studio, delete the *.vshost.*, and what is left is usually what you need to distribute.

I say usually, because if you used some third party stuff in your application, it might not be included there and you might have to install it separately. Many third party tools have the bad habit of installing on your development machine in a way that does not flag Visual Studio of the need to be distributed with the application, and they are not copied in the application directory as they should.
jdanaAuthor Commented:

Your response is one of the best EE responses I've ever seen (and I've seen quite a few).  I've incorporated the full posting into my .NET lesson.  


jdanaAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.