我正在尝试将我的API从.NET Core 2.2升级到3.0,但是我无法让Azure Web应用程序使用3.0来运行该应用程序。
我有一个多阶段发布流程,使用
我已按照 此处 的指示安装了预览扩展,并运行 PowerShell 命令
在 Powershell 中运行
我的构建管道配置:
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Release'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core 3'
inputs:
version: 3.x
- script: dotnet tool install --global dotnet-ef
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- task: efcore-migration-script-generator-task@0
inputs:
projectpath: 'Models/Models.csproj'
databasecontexts: 'DataContext'
startupprojectpath: 'Api/Api.csproj'
targetfolder: '$(build.artifactstagingdirectory)/migrations'
- script: dotnet publish --output $(Build.ArtifactStagingDirectory)
displayName: 'dotnet publish $(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
我有一个多阶段发布流程,使用
Azure App Service Deploy
任务将制品发布到 Azure。一切都正常运行。我已按照 此处 的指示安装了预览扩展,并运行 PowerShell 命令
Test-Path D:\home\SiteExtensions\AspNetCoreRuntime.3.0.x86\
返回 true
。但我仍然看到以下错误。
ANCM 无法找到本机依赖项。在 Powershell 中运行
dotnet --version
和 dotnet --list-runtimes
命令,发现它只识别 .NET Core 2 运行时,尽管 3.0 运行时已经存在。据我所知,安装站点扩展并不会更新路径以使用新的 dotnet
版本,而 Azure Devops 部署任务似乎没有任何选项可以覆盖默认设置。有人成功通过 Azure Devops 发布流程部署 .NET Core 3 应用程序吗?