Azure devops linux虚拟机上的Azure DevOps管道PostSharp故障

Azure devops linux虚拟机上的Azure DevOps管道PostSharp故障,azure-devops,continuous-integration,azure-pipelines,postsharp,Azure Devops,Continuous Integration,Azure Pipelines,Postsharp,我曾计划将我的DevOps管道移动到linux虚拟机。不幸的是,我面临着这个问题。我正在我的.NETCore2.2项目中使用Postsharp 6 Build FAILED. /home/vsts/.nuget/packages/postsharp/6.1.18/build/PostSharp.targets(148,5): error MSB4062: The "PostSharp.MSBuild.PostSharpValidateLanguageVersion" task could no

我曾计划将我的DevOps管道移动到linux虚拟机。不幸的是,我面临着这个问题。我正在我的
.NETCore2.2
项目中使用Postsharp 6

Build FAILED.

/home/vsts/.nuget/packages/postsharp/6.1.18/build/PostSharp.targets(148,5): error MSB4062: The "PostSharp.MSBuild.PostSharpValidateLanguageVersion" task could not be loaded from the assembly /home/vsts/.nuget/packages/postsharp/6.1.18/build//net471/PostSharp.MSBuild.v6.1.18.Release.dll. Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. [/home/vsts/work/1/s/Core.csproj]
/home/vsts/.nuget/packages/postsharp/6.1.18/build/PostSharp.targets(148,5): error MSB4062: Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [/home/vsts/work/1/s/Core.csproj]

0 Warning(s)
1 Error(s)
生成失败。
/home/vsts/.nuget/packages/postsharp/6.1.18/build/postsharp.targets(148,5):错误MSB4062:未能从程序集/home/vsts/.nuget/packages/postsharp/6.1.18/build//net471/postsharp.MSBuild.v6.1.18.Release.dll加载“postsharp.msharp验证语言版本”任务。无法加载文件或程序集“Microsoft.Build.Utilities.v4.0,版本=4.0.0.0,区域性=中性,PublicKeyToken=b03f5f7f11d50a3a”。系统找不到指定的文件。[/home/vsts/work/1/s/Core.csproj]
/home/vsts/.nuget/packages/postsharp/6.1.18/build/postsharp.targets(148,5):错误MSB4062:确认声明正确,程序集及其所有依赖项可用,并且任务包含实现Microsoft.build.Framework.ITask的公共类。[/home/vsts/work/1/s/Core.csproj]
0个警告
1个错误

PostSharp在Linux虚拟机上不工作

唯一的解决方案是在yaml上使用
Windows Server
。甚至Selenium也删除了Postharp支持

trigger:
- master

pool:
  vmImage: 'windows-2019'

variables:
  buildConfiguration: 'Release'

steps:
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
你可以看图片来更好地理解步骤


  • 更新
PostSharp 6.3.5预览版版本支持Linux和macOS版本

此外,还可以创建docker图像。我正在使用这些图像:

FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build

确切地说,PostSharp只支持在Windows上构建,但生成的程序集也可以在Linux上执行。对Linux上构建的支持在路线图上具有很高的优先级。