我计划将DevOps Pipeline迁移到linux vm。不幸的是,我面临着这个问题。我在.Net Core 2.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)
答案 0 :(得分:2)
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)'
您可以查看图片以更好地了解步骤。