views:

384

answers:

1

HI.

Is it possible to exclude specific files or folders from "Build Deployment Package" function in VS 2010?

In VS 2008 it was possible with Web Deployment package, unfortunately this project is not available in VS2010.

Thank you.

A: 

I need to exclude some files also, I want to remove assemblies .xml files from the deploy (I don't need them on the server), could find anything on the web so I decide to look for it on my own.

After digging into the msbuild of the MsPublish I found it, you need to setup the following in your project (edit manualy the .csproj):

<ItemGroup>
  <!-- This will exclude the .xml files from the bin folder -->    
  <ExcludeFromPackageFiles Include="$(OutputPath)*.xml" />  

  <!-- This will exclude the tmp folder from the bin folder -->    
  <ExcludeFromPackageFolders  Include="$(OutputPath)tmp" />  
</ItemGroup>
Shay Erlichmen