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.

4

1 回答 1

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>
于 2009-06-22T17:55:13.297 回答