Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010: How to exclude folder/files from "Build Deployment Package"?

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.

like image 730
Feryt Avatar asked Feb 26 '10 10:02

Feryt


1 Answers

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), I couldn't 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>
like image 56
Shay Erlichmen Avatar answered Sep 19 '22 00:09

Shay Erlichmen