Skip to content

Instantly share code, notes, and snippets.

@akuryan
Last active January 11, 2016 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akuryan/3c1c8fd7426b4829a34c to your computer and use it in GitHub Desktop.
Save akuryan/3c1c8fd7426b4829a34c to your computer and use it in GitHub Desktop.
Modify .csproj to include file content in delivery only once
<PropertyGroup>
<OnBeforePackageUsingManifest>
$(OnBeforePackageUsingManifest);
AddSpecificSkipRule;
</OnBeforePackageUsingManifest>
<AfterAddIisSettingAndFileContentsToSourceManifest>
$(AfterAddIisSettingAndFileContentsToSourceManifest);
AddSpecificSkipRule;
</AfterAddIisSettingAndFileContentsToSourceManifest>
<!-- Due to known error (http://stackoverflow.com/questions/12576662/msdeploy-skip-rules-when-using-msbuild-publishprofile-with-visual-studio-2012)
we should use MsDeployExe for delivery, if we want to skip only several folders
And as we are skipping SeoChecker.config update - we shall use it always-->
<UseMsDeployExe>true</UseMsDeployExe>
</PropertyGroup>
<Target Name="AddSpecificSkipRule" >
<ItemGroup>
<MsDeploySkipRules Include="SkipUpdateSeoChecker">
<SkipAction>Update</SkipAction>
<ObjectName>dirPath</ObjectName>
<AbsolutePath>Umbraco/Plugins/SEOChecker/Config</AbsolutePath>
<XPath>
</XPath>
</MsDeploySkipRules>
<MsDeploySkipRules Include="SkipUpdateSeoCheckerConfig">
<SkipAction>Update</SkipAction>
<ObjectName>filePath</ObjectName>
<AbsolutePath>Umbraco/Plugins/SEOChecker/Config/SEOChecker\.config$</AbsolutePath>
<XPath>
</XPath>
</MsDeploySkipRules>
<MsDeploySkipRules Include="SkipUpdateSeoCheckerConfig">
<SkipAction>Update</SkipAction>
<ObjectName>filePath</ObjectName>
<AbsolutePath>Umbraco\\Plugins\\SEOChecker\\Config\\SEOChecker\.config$</AbsolutePath>
<XPath>
</XPath>
</MsDeploySkipRules>
<MsDeploySkipRules Include="SkipUpdateContourForms">
<SkipAction>Update</SkipAction>
<ObjectName>filePath</ObjectName>
<AbsolutePath>App_Plugins\\UmbracoForms\\Data\\.*$</AbsolutePath>
<XPath>
</XPath>
</MsDeploySkipRules>
</ItemGroup>
</Target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment