使用包含在输出中的 resx 资源文件构建

问题描述 投票:0回答:0

我有两个

.NET Framework
解决方案,每个解决方案都有一个
\Resources
文件夹,其中包含
resx
格式的文件
strings.cs-CZ.resx
.

一个解决方案是在 Azure DevOps 上构建的,Visual Studio 构建 步骤具有这些

MSBuild Arguments

/p:DeployOnBuild=true /p:PackageLocation="$(build.artifactstagingdirectory)\\" /p:PublishProfile="$(build.sourcesdirectory)\App.Api\Properties\PublishProfiles\VSTS-InPlacePublish.pubxml"

构建管道生成一个人工制品,其中包含一个

\Resources
文件夹,其中包含解决方案中的所有
.resx
文件。

第二个解决方案是在 Azure DevOps 上构建的,具有相同的 Visual Studio 构建 步骤,但具有这些

MSBuild Arguments

/p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:SkipInvalidConfigurations=true /p:publishUrl="$(build.artifactstagingdirectory)\\App\\"

此构建管道工件根本不包含

\Resources
文件夹,并且完全缺少任何
.resx
文件。

我正在阅读有关

msbuild
及其开关的各种文章,但我找不到如何获得第二个构建步骤来输出第一个构建步骤使用的资源文件。

我可以识别的解决方案之间唯一的关键区别是第一个包含以下

\App.Api\Properties\PublishProfiles\VSTS-InPlacePublish.pubxml
文件,而第二个不包含:

<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>vsts-publish</publishUrl>
    <DeleteExistingFiles>False</DeleteExistingFiles>
  </PropertyGroup>
</Project>

如何修改第二个构建步骤参数以输出构建工件中的资源?

azure azure-devops resx msbuild-task .net-4.7.2
© www.soinside.com 2019 - 2024. All rights reserved.