[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

.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.
0
jdana
Asked:
jdana
  • 2
1 Solution
 
Jacques Bourgeois (James Burger)Commented:
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.
0
 
jdanaAuthor Commented:
James,

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.  

Thanks!

J
0
 
jdanaAuthor Commented:
Thanks!
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now