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.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With