Ошибка PostSharp в конвейере Azure DevOps на виртуальной машине Linux - PullRequest
2 голосов
/ 09 мая 2019

Я планировал перенести свой DevOps Pipeline на linux vm.К сожалению, я столкнулся с этой проблемой.Я использую Postsharp 6 в моем .Net Core 2.2 проекте.

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)

1 Ответ

2 голосов
/ 09 мая 2019

PostSharp не работает в Linux vm.

Единственное решение - использовать Windows Server на yaml. Даже Selenium убрал поддержку Postharp.

trigger:
- master

pool:
  vmImage: 'windows-2019'

variables:
  buildConfiguration: 'Release'

steps:
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'

Вы можете посмотреть на фотографии, чтобы лучше понять шаги.

yaml configuration success on windows server

...