3

I'm trying to make a Setup Project (Installer) using Visual Studio Community Edition 2015

When I Build my VB.NET (WinForms) project in Release mode, the following files are created:

  • MyApp.exe
  • MyApp.exe.config
  • MyApp.pdb
  • MyApp.vshost.exe
  • MyApp.vshost.exe.config
  • MyApp.vshost.exe.manifest
  • MyApp.xml

Which of these files should I add to my Setup Project? All of them? What are the vshost.exe files? I understand the .config file, which is used for saving settings, but what's with the .xml file?

Also, I want my user settings (config file, set to "User Scope") to be unique for each account in Windows. Do I just put the .config file in the Application Data Folder? (I tried that, and it draws a blue line below the .config file name).

garlic
  • 197
  • 1
  • 11
  • 1
    @codeMonger123 : The `*.vshost.*` files are just for the _Visual Studio Hosting Process_. Why would he need those outside the development environment? – Visual Vincent May 13 '16 at 16:45
  • forgot to delete it. He does need MyApp.exe.config. – codeMonger123 May 13 '16 at 16:56
  • @codeMonger123 : Could you explain to me why? I've never included it with my applications. – Visual Vincent May 13 '16 at 16:58
  • you never included the app.config file???? I guess if you never reference the app.config file in your .net program I suppose you might not need it. Honestly I have never not referenced the app.config – codeMonger123 May 13 '16 at 17:00
  • @codeMonger123 : I don't think the `MyApp.exe.config` is the same as `app.config`. `app.config` is usually embedded (AFAIK). – Visual Vincent May 13 '16 at 17:15

3 Answers3

2

As far as I know the only file you really need is MyApp.exe. If you need debug information (which is good if you for example want to know at which line an exception occurred, or you want a more precise stack trace) you can also copy the MyApp.pdb file.

The .vshost-files are just for the Visual Studio Hosting Process. They're only used in the development environment when debugging your application, so you don't need them.

As for the settings, they are auto-generated for each new user (thus they are user specific, like you want), so you won't need that file either.

Finally, the .xml file is also just a file used in the development environment. It contains XML comments used by the IntelliSense for it to be able to display custom descriptions when showing your custom classes/methods/variables/etc.

So in conclusion you really only need MyApp.exe and possibly MyApp.pdb.

Visual Vincent
  • 18,045
  • 5
  • 28
  • 75
  • I wonder though, why does it generate the .config file, when it's not really necessary to add it to a Setup Project? – garlic May 13 '16 at 17:17
  • @garlic : Does the `.config` file contain your settings? If so, it's probably because Visual Studio want to keep track of everything while debugging. When used outside the VS environment the settings will be automatically created (if they don't exist) in the current user's `Local Application Data` folder. Thus they are user specific. – Visual Vincent May 13 '16 at 17:20
  • Yes, the .config file in the Release folder contains my settings, the default settings I'd like my users to see when the program is first run. – garlic May 13 '16 at 17:25
  • @garlic : Well if I am not mistaken the auto-generated settings are the default. – Visual Vincent May 13 '16 at 17:51
2

It is better if you configure your project correctly so you don't have to guess. Be sure to have the Release configuration selected. Then:

  • Use Project > Properties > Debug tab, untick the "Enable the Visual Studio hosting process" option.
  • Use Project > Propeties > Compile tab > Advanced Compile Options, Generate debug-info = None.
  • Use Project > Properties > Compile tab, untick the "Generate XML document file" option.
  • Use Build > Clean. Delete the remaining vshost files by hand.
  • Use Build > Build. Only the .exe and the .config file should be there.
  • -
Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
1

You dont need these

MyApp.vshost.exe
MyApp.vshost.exe.config
MyApp.vshost.exe.manifest

Example

http://stackoverflow.com/questions/774187/what-is-the-purpose-of-vshost-exe-file

You should only need: MyApp.exe MyApp.exe.config MyApp.pdb MyApp.xml

codeMonger123
  • 505
  • 5
  • 13
  • What about the file 'MyApp.exe.config' ? If I put that in the same folder as my main executable (Program Files), how will the program make changes to that settings file if the user's not an Administrator? If I put that config file in Application Data folder, the Setup Project (Visual Studio) puts a squiggly line on the file name, without an actual error description. – garlic May 13 '16 at 16:56
  • what changes do you want it to make if the user's not an Administrator?The file should go in the same folder as your main exe – codeMonger123 May 13 '16 at 16:58
  • I make changes through managed code (My.Settings), for example: to save a CheckBox value's checked state. When I use My.Settings., I don't change the file directly myself, it gets done through managed code behind the scenes of .NET. So if the .config file is sitting in the same location as the main executable, saving the setting will run into permission problems if the user's not an Administrator. I don't want my user to run my program as an Administrator just to be able to save setting. Or am I missing something here? – garlic May 13 '16 at 17:03
  • 1
    @garlic : I explained how the settings work in my answer. – Visual Vincent May 13 '16 at 17:06