I'm trying to setup a common publish project using the Helix Publishing Pipeline.
When I publish to my local temp directory, it publishes Sitecore Assemblies and also other files like HtmlAgilitypack.dll
, Newtonsoft.dll
, System.Web.Helpers.dll
etc.
Using Visual Studio 2019.
How can I exclude them?
Should the setting be in Local.pubxml
or should it be in the .wpp.targets
file?
I tried using the commented code in template - AdditionalFilesToRemoveFromTarget
, <SitecoreAssembliesToExclude
. None worked.
Here are my files:
Local.pubxml
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<PublishUrl>C:\out\Stratum</PublishUrl>
<LaunchSiteAfterPublish>False</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<DeleteExistingFiles>False</DeleteExistingFiles>
</PropertyGroup>
<Target Name="EnsurePublishUrl" BeforeTargets="Build">
<Error Condition="'$(PublishUrl)' == ''" Text="Please configure a publishUrl in $(MSBuildProjectName)/Properties/PublishProfiles/Local.pubxml. You may need to reload your solution to apply the change.
Auto-publish can be disabled in $(MSBuildProjectName).wpp.targets." />
</Target>
</Project>
Stratum.Publish.Website.wpp.targets
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<SitecoreAssembliesToExclude Include="@(SitecoreAssemblies)" />
</ItemGroup>
<PropertyGroup>
<EnableAutoPublish>false</EnableAutoPublish>
<AutoPublish Condition="'$(AutoPublish)' == '' and '$(EnableAutoPublish)' == 'true' and '$(Configuration)' == 'Debug' and '$(BuildingInsideVisualStudio)' == 'true' and '$(PublishProfile)' != ''">true</AutoPublish>
<AutoPublishDependsOn Condition="'$(AutoPublish)' == 'true'">
$(AutoPublishDependsOn);
WebPublish
</AutoPublishDependsOn>
</PropertyGroup>
<Target Name="AutoPublish" AfterTargets="Build" DependsOnTargets="$(AutoPublishDependsOn)">
</Target>
</Project>
packages.config
<packages>
<package id="RichardSzalay.Helix.Publishing.WebRoot" version="1.5.6" targetFramework="net48" />
<package id="Sitecore.Assemblies.Platform" version="10.3.0" targetFramework="net48" />
</packages>