我需要從項目發佈中排除文件夾媒體,umbraco和umbraco_client。這些文件夾很少更改,我不想每次都等待,直到它們在FTP服務器上發佈期間被複制。下面是我的配置local.pubxml:從Visual Studio 2015出版物中排除文件夾
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>My_path</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
<ExcludeFoldersFromDeployment>media;umbraco;umbraco_client</ExcludeFoldersFromDeployment>
<MSDeployUseChecksum>true</MSDeployUseChecksum>
<AfterAddIisSettingAndFileContentsToSourceManifest>AddCustomSkipRules</AfterAddIisSettingAndFileContentsToSourceManifest>
</PropertyGroup>
<Target Name="AddCustomSkipRules">
<Message Text="Adding Custom Skip Rules" />
<ItemGroup>
<MsDeploySkipRules Include="SkipmediaFolder">
<ObjectName>dirPath</ObjectName>
<AbsolutePath>$(_DestinationContentPath)\\media</AbsolutePath>
<XPath>
</XPath>
</MsDeploySkipRules>
<MsDeploySkipRules Include="SkipUmbracoFolder">
<ObjectName>dirPath</ObjectName>
<AbsolutePath>$(_DestinationContentPath)\\umbraco</AbsolutePath>
<XPath>
</XPath>
</MsDeploySkipRules>
<MsDeploySkipRules Include="SkipUmbraco_clientConfig">
<ObjectName>dirPath</ObjectName>
<AbsolutePath>$(_DestinationContentPath)\\umbraco_client</AbsolutePath>
<XPath>
</XPath>
</MsDeploySkipRules>
</ItemGroup>
</Target>
</Project>
該媒體文件夾不會公佈後,但一把umbraco和umbraco_client文件夾仍然繼續在出版過程中進行復制。之後,我從項目中排除了umbraco和umbraco_client文件夾,但它也不能解決問題。有任何想法嗎? :)
這種方法對我來說總是有效。當您最初完成時可能會出現問題。你不能刪除當前的配置文件,並重新開始?有時候VS很有氣質。 –