2

Why does my web deployment project, when compiled, create a Visual Studio project file and a bunch of other unwanted/unneed files in the release and debug folders?

The debug files are also being included even though I have the "Generate debug information" option unchecked when in release mode.

I'm also getting some obj folder that contains another set of debug and release folders that seem out of place.

In short, it's creating a lot of non-release files. I am using a ASP.NET MVC project, but I don't think that should make a difference.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Aaron
  • 413
  • 1
  • 4
  • 14
  • Why is there a Visual Studio project file (.csproj) in output folder and what is the purpose of this? It there some way to get a clean output in release mode so I can copy the contents directly to a virtual directory? – Aaron Jun 22 '09 at 20:05

1 Answers1

6

By default Visual Studio generates PDB files in both debug and release mode. The difference is that in debug mode the entire symbol table is loaded while in release mode only the key symbols are loaded.

You can completely disable PDB generation in release mode by setting generate debug info in advanced compile options to none.

If you want to have a clean output folder you can add the following ItemGroup to your web deployment project's file (.wdproj):

<ItemGroup>
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\obj\**\*.*" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.csproj" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.scc" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.user" />
    <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.vspscc" />
</ItemGroup>
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928