我创建了一个
.NET8 MAUI Class Library
用于 MAUI 项目。存储库位于 Azure DevOps
,我尝试通过 NuGet 构建和发布包。
为此,我编写了一个 YAML 文件
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: UseDotNet@2
displayName: 'Use dotnet 8'
inputs:
version: '8.0.x'
- task: CmdLine@2
inputs:
script: 'dotnet workload install maui'
- task: DotNetCoreCLI@2
displayName: Restore packages
inputs:
command: 'restore'
feedsToUse: 'select'
vstsFeed: 'c800d0d7-e2af-4567-997f-de7cf7888e6c'
- task: DotNetCoreCLI@2
displayName: Build project
inputs:
command: 'build'
projects: '**/PSC.Maui.Components.BottomSheet.csproj'
arguments: '--configuration $(buildConfiguration)'
当管道运行时,我收到此错误
Generating script.
Script contents:
dotnet workload install maui
========================== Starting Command Output ===========================
/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/42901c0d-f407-4f75-912b-f93132efa865.sh
Workload ID maui isn't supported on this platform.
##[error]Bash exited with code '1'.
Finishing: CmdLine
然后,我尝试在本地创建NuGet包,但是上传时NuGet网站无法识别。
如何更改管道?
.Net MAUI 不支持 Linux,因此您既不能在 Linux 上构建,也不能从 Linux 构建。
参见这里