在Azure DevOps上使用azure-pipelines.yml
安装多个.NET Core SDK版本是否可能?如果可以,如何操作?
我正在尝试使用ElectronNET构建Blazor Server应用程序。 在我的本地计算机上,我可以轻松运行electronize build /target win
。 但是,在Azure DevOps上运行构建时,会出现以下错误:
The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found.
- The following frameworks were found:
3.0.0-preview7-27912-14 at [/opt/hostedtoolcache/dotnet/shared/Microsoft.NETCore.App]
我的 azure-pipelines.yml
长这个样子:
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: DotNetCoreInstaller@0
displayName: Install .NET Core 2.2 SDK
inputs:
packageType: 'sdk'
version: '2.2.401'
- script: |
dotnet tool install ElectronNET.CLI -g
displayName: 'Install global tool ElectronNET.CLI'
- task: DotNetCoreInstaller@0
displayName: Install Latest .NET Core 3.0 SDK
inputs:
packageType: 'sdk'
version: '3.0.100-preview7-012821'
- script: |
cd MyProject
electronize build /target win
displayName: 'Build Windows app with ElectronNET'