Mohaaron
Mohaaron

Reputation: 451

Why does a Visual Studio 2008 web deployment project create unwanted files?

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.

Upvotes: 2

Views: 1067

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039428

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>

Upvotes: 6

Related Questions