是否可以使用Azure构建管道和DotNetCoreCLI@2任务为ClassLibrary项目指定目标框架?还是我们必须恢复到使用脚本并手动调用dotnet publish命令?
我管道里的片段YAML
variables:
buildConfiguration: 'Debug'
steps:
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
publishWebProjects: false # Required when command == Publish
projects: 'TestProject/Test/Test.csproj'
configuration: '$(BuildConfiguration)'来自我的.csproj:
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net45</TargetFrameworks>
</PropertyGroup>我将文档这里用于DotNetCoreCLI@2任务,但并不总是很好。
编辑:--我应该补充说,目前构建完全失败了,因为:
The 'Publish' target is not supported without specifying a target framework.
The current project targets multiple frameworks, please specify the framework
for the published application. 发布于 2018-11-20 14:38:44
DotNetCoreCLI@2任务可以使用arguments属性进行扩展,您可以在该属性上指定框架(以及构建配置):
steps:
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
publishWebProjects: false # Required when command == Publish
projects: 'TestProject/Test/Test.csproj'
arguments: '--configuration $(BuildConfiguration) --framework netcoreapp2.1'https://stackoverflow.com/questions/52628444
复制相似问题