Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Release Build contains extra files, do I need these?

Tags:

c#

.net

windows

I built my program with Visual Studio 2012 Express, bin/release/ contains some other files as well as the exe. Do I need to distribute these files?

  • myApp.exe.config
  • myApp.pdb
  • myApp.vshost.exe
  • myApp.vshost.exe.config
  • myApp.vshost.exe.manifest
like image 526
Drahcir Avatar asked Mar 19 '13 16:03

Drahcir


People also ask

Are .PDB files needed for Release?

PDB files contain debug symbols that allow you to debug your binary even in release mode. You don't have to (and probably shouldn't deploy them), as they might be used to reverse engineer your application.

Why do we need PDB file?

Program database (PDB) is a file format (developed by Microsoft) for storing debugging information about a program (or, commonly, program modules such as a DLL or EXE). PDB files commonly have a . pdb extension. A PDB file is typically created from source files during compilation.

What is the difference between Release and debug in Visual Studio?

Visual Studio projects have separate release and debug configurations for your program. You build the debug version for debugging and the release version for the final release distribution. In debug configuration, your program compiles with full symbolic debug information and no optimization.

How do I create a PDB file for Release build?

Set “Project->Project Properties->Configuration Properties->Linker->Debugging->Generate Debug Info” to “Yes”. Once you select this option, the next option “Generate Program Database File” will show the default path and name for the PDB file. If you build your solution it will generate <Targetname>. PDB file.


2 Answers

You do (probably) need

  • myApp.exe.config

That contains configuration settings for your executable.

You don't need the others.

  • myApp.pdb

Contains debug symbols

  • myApp.vshost.*

Used by Visual Studio when debugging (vshost means Visual Studio Host).

like image 173
Eric J. Avatar answered Oct 02 '22 07:10

Eric J.


It depends. The other answers are correct in saying that myApp.exe and myApp.exe.config are the essential choices.

You may also want to ship the PDB file. If you do, you have more options for debug purposes (for example - it's possible to log the line number in code where an exception was thrown).

There's probably not any use cases where you want to ship the vshost files.

HOWEVER: Shipping anything apart from just the exe and the config can make your software easier to reverse engineer; and increases your package size.

I think in most cases the answer will be, only ship myApp.exe and myApp.exe.config for those reasons.

Have a look at these previous questions for further information:

Advantages and Disadvantages of Including PDB Files

Release Version Has Still PDB File

How To Turn Off PDB Generation

What Is The Purpose Of vshost exe

like image 29
HaemEternal Avatar answered Oct 02 '22 08:10

HaemEternal