0

I have a C#/Winforms project in Visual Studio. I can build it, and all is fine, but it generates a lot of excessive files. Is there any way to avoid this? It is not very intentional, if you want to distribute it to non-technical stakeholders during the process.

I have three files (bold formated) which seems to be required. After some research, I fould a way to avoid the .vshost files (formated as italic), but I still have some files left, which I cannot figure out what does (normal formating).

  • SomeLibrary.Json.dll
  • SomeLibrary.Json.xml
  • SomeAPI.Api.Client.dll
  • SomeAPI.Api.Client.xml
  • MyProgram.exe
  • MyProgram.exe.config
  • MyProgram.pdb
  • MyProgram.vshost.exe
  • MyProgram.vshost.exe.config
  • MyProgram.vshost.exe.manifest

How do I make a release build without these remaining non-required files?

Jakob Busk Sørensen
  • 5,599
  • 7
  • 44
  • 96
  • Thanks for the comment, I tried searching but found nothing. Possibly due to the very cryptic name. I will check if this solves my problem, and then address the possible duplicate post issue. – Jakob Busk Sørensen Jun 12 '17 at 07:09
  • @Abhishek thanks once again. I manage to remove three unnessesary files from the build, but I still have a few files left, which does not seem to have any effect? I edited the post accordingly. – Jakob Busk Sørensen Jun 12 '17 at 07:21
  • @Noceo these aren't non-required files and they *are* well documented. Those are the files used when you debug your application. If you don't want them, make a Release build – Panagiotis Kanavos Jun 12 '17 at 07:24
  • @PanagiotisKanavos I am making a release build, but I can see that I missed that in my original post. Thanks for pointing it out. – Jakob Busk Sørensen Jun 12 '17 at 07:32

1 Answers1

2
  • The xml files contain documentation used to make intellisense work when referencing the dll's with the same name. If these are your libraries, you can go to Project Properties and uncheck XML documentation file. Otherwise, see https://stackoverflow.com/a/2300049/292411
  • pdb files contain debugging information. You can go to Project Properties -> Build -> Advanced and set Debug Info to none if you don't want to generate this file
  • The .config files are configuration files generated by Visual Studio probably because your project contains an App.Config file. If you're running the application without the .config files, you might as well delete the App.Config file

Abhishek's comment already contained information that helped you remove the vshost files.

Personally I find it easier to just pick the files myself, especially when you're working in a team you sometimes just want to settle with what everyone's used to.

C.Evenhuis
  • 25,996
  • 2
  • 58
  • 72
  • Thank you very much. I think that brings me to a point, where I now understand **all** the files (more or less at least). I will mark this as the correct answer, but make sure to check Abhishek's comment as well. – Jakob Busk Sørensen Jun 12 '17 at 07:35