【发布时间】:2020-09-06 13:34:27
【问题描述】:
目前我正在使用此发布配置文件 (.pubxml) 进行发布:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<PublishProvider>FileSystem</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ProjectGuid>17e8801d-27bf-4b5a-a0f5-125b0e52dde9</ProjectGuid>
<SelfContained>false</SelfContained>
<publishUrl>C:\000\Test</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
<EnvironmentName>Production</EnvironmentName>
</PropertyGroup>
<ItemGroup>
<MaxifiedJs Include="wwwroot/**/*.js" Exclude="wwwroot/**/*.min.js" />
<MaxifiedCss Include="wwwroot/**/*.css" Exclude="wwwroot/**/*.min.css" />
<Content Update="@(MaxifiedJs)" CopyToPublishDirectory="Never" />
<Content Update="@(MaxifiedCss)" CopyToPublishDirectory="Never" />
</ItemGroup>
</Project>
它运行良好,并从输出文件夹中删除了所有未缩小的文件。但是当文件没有缩小版本时会出现问题。在这种情况下,没有发布任何内容。仅当文件具有缩小版本时,如何使此规则有效?如果没有缩小文件,则发布常规 .js 或 .css 我在官方文档或 StackOverflow 中没有找到任何解决方案。
【问题讨论】:
标签: visual-studio asp.net-core msbuild webdeploy