【发布时间】:2020-01-30 03:35:32
【问题描述】:
我正在尝试将我的 API 从 .NET Core 2.2 升级到 3.0,但我无法让 Azure Web 应用程序真正运行使用 3.0 的应用程序。
我的构建管道配置:
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。一切运行都没有问题
我已经按照here 的指示安装了预览扩展,运行powershell 命令Test-Path D:\home\SiteExtensions\AspNetCoreRuntime.3.0.x86\ 返回true。我仍然看到以下错误。
ANCM Failed to Find Native Dependencies
回到 Powershell,运行 dotnet --version 和 dotnet --list-runtimes 表明它只识别 .NET Core 2 运行时,尽管存在 3.0 运行时。据我所知,安装站点扩展不会更新使用新 dotnet 版本的路径,并且 Azure Devops 部署任务似乎没有任何选项可以覆盖默认值。是否有人设法通过 Azure Devops Release Pipelines 部署了 .NET Core 3 应用程序?
【问题讨论】:
-
我怀疑 azure App 服务是否支持 .Net Core 3.0。 stackoverflow.com/questions/58133089/…
-
@Venky 如果使用站点扩展,他们声称支持它:docs.microsoft.com/en-us/aspnet/core/host-and-deploy/azure-apps/…
标签: azure .net-core azure-devops azure-web-app-service .net-core-3.0