Search code examples
tfsvisual-studio-2013pdb-filesvs-web-site-project

VS 2013 - pdb files are added automatically to source control


I have a solution with a web site project and two library projects (.dll). The web site has references to the two dlls. The references are added as project references. The web site also has a binary reference to log4net.dll.

When we build the solution the pdb files from the two project references is automatically added to TFS source control under the web site Bin folder.

How can I prevent this from happening?

pdb files added to TFS source control

Peter B. Frederiksen


Solution

  • By defaut a Web Site project has no option to include or exclude files. As such they do not work well with source control systems and are not recommended for use.

    You need to flip over to a Web Application. This is simple but has ramification.

    1. Create an empty web application
    2. Update the settings and assemblyinfo to be what you want
    3. Copy only the Project file and the AssemblyInfo files into the Web Site location (maintain folders.)
    4. Add the new project to your solution with "open existing"
    5. Make work / build
    6. Remove web site from solution

    Remember that your files are now pre-built and you may need to fix duplicate class names that are allowed in web sites.