一起构建.NET标准和asp.net核心

问题描述 投票:1回答:1

我有一个带有asp.net core 3.1和一些.net 2.0标准库的小型解决方案。我的管道失败,并显示以下内容:

[错误] C:\ Program Files \ dotnet \ sdk \ 3.1.201 \ Microsoft.Common.CurrentVersion.targets(3032,5):错误MSB4216:无法运行“ GenerateResource”任务,因为MSBuild无法使用运行时“ CLR4”创建或连接到任务主机和架构“ x86”。请确保(1)请求的运行时和/或体系结构在计算机上可用,并且(2)所需的可执行文件“ C:\ Program Files \ dotnet \ sdk \ 3.1.201 \ MSBuild.exe”存在并且可以运行。

这是我的管道:

trigger:
- none

pool:
  vmImage: 'windows-latest'

variables:
  solution: 'Frontend/VendorFormAPI/VendorFormAPI.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:

- task: NuGetCommand@2
  inputs:
    command: 'restore'
    restoreSolution: '$(solution)'
    feedsToUse: 'select'

- task: DotNetCoreCLI@2
  displayName: 'Building solution'
  inputs:
    command: 'build'
    projects: '$(solution)'

- task: DotNetCoreCLI@2
  displayName: 'Publish project'
  inputs:
    command: 'publish'
    publishWebProjects: true
    arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
    projects: '$(solution)'

- task: PublishBuildArtifacts@1
  displayName: 'Drop artifacts to container'
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'drop'
    publishLocation: 'Container'

不可能建立这个吗?

asp.net-core azure-devops azure-pipelines .net-standard
1个回答
0
投票

这是由于解决方案中的Windows窗体项目。

© www.soinside.com 2019 - 2024. All rights reserved.