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



Question:

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.


Solution:1

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>  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »