Pages - Menu

How to exclude files and folders in .Net for deployment


We want to exclude some files or folders when we deploy / publish a project. They are mostly development only or internal folders that is not needed in productions.


  1. Create a new XML file in the project folder (the same folder that holds the .csproj or .vbproj file) and name it <projectname>.wpp.targets.
  2. Use the following as the base, and modify to include what folders / files to exclude.
<?xml version="1.0" encoding="utf-8" ?>
<project toolsversion="4.0" xmlns="">
    <excludefrompackagefolders include="[semi-colon-separated-folder-list]">
    <excludefrompackagefiles include="[semi-colon-separated-files-list]">

Further Reading

No comments:

Post a comment