kudu不支持.net core 3.1:无法从bitbucket自动部署我的.net core 3.1功能

nhhxz33t  于 2021-06-21  发布在  Kudu
关注(0)|答案(1)|浏览(396)

我使用bitbucket将我的功能应用程序部署到azure:当我在bitbucket中签入master时,我的代码将部署到azure。
这很好,但现在我升级了我的功能应用程序从.net核心2.2到3.1和。。。
现在我有个例外:

Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling function App deployment with dotnet.exe.
D:\Program Files (x86)\dotnet\sdk\2.2.109\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.1.  Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.1. [D:\home\site\repository\xxxxxx\xxxxxx\xxxxxx.csproj]
D:\Program Files (x86)\dotnet\sdk\2.2.109\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.1.  Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.1. [D:\home\site\repository\xxxxxx\UnitTest\UnitTest.csproj]
Failed exitCode=1, command=dotnet restore "D:\home\site\repository\xxxxxx\xxxxxx.sln"
An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu\85.11226.4297\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

所以它说它不支持.NETCore3.1
这是一个明显的错误,因为我刚刚更新了它。
但我不知道是什么给了我这个错误。我无法想象这是azure的抱怨,因为他们确实支持.NETCore3.1(https://docs.microsoft.com/en-us/azure/azure-functions/functions-versions). 我也无法想象源代码是内置的bitbucket(是吗?),bitbucket不支持.NETCore3.1?
我找到了一些关于“kudu”这个词的信息。似乎它在azure上,负责从git到azure的部署。所以现在我想知道为什么kudu不支持.netcore3.1
编辑2:我列出的框架:

D:\home>dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.14 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.15 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.8 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.14 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.15 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.8 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.1 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.2 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.1 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.16 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.13 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.14 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.8 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.2 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.1 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]

编辑3:
会不会是这个host.json错了?

{
    "version": "2.0"
}

没有读到它必须改变,但也许?

mtb9vblg

mtb9vblg1#

在写另一条评论时找到了原因。据我所知,您正在将源代码推送到appservice,并让kudu构建应用程序。这不起作用,因为虽然安装了3.1运行时,但没有安装3.1 sdk。
你也会看到,如果你跑 dotnet --list-sdks . 您需要先构建应用程序,然后再将其推送到kudu,或者等到3.1sdk安装到windows系统上。您还可以尝试使用linux应用程序服务。
https://github.com/azure/app-service-announcements/issues/217
sdk部署将在运行时全局可用后进行。
三个多月后,运行时部署仍未完成。所以我希望sdk部署需要更多的时间。

相关问题