linux VM 上的 Azure DevOps 管道 PostSharp 失败
Azure DevOps Pipeline PostSharp failure on linux VM
我曾计划将我的 DevOps 管道移动到 linux 虚拟机。不幸的是,我遇到了这个问题。我在 .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)
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
我曾计划将我的 DevOps 管道移动到 linux 虚拟机。不幸的是,我遇到了这个问题。我在 .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)
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