.net 8 预览版 Linux 上托管的 Azure 应用服务无法启动,显然要求安装 8.0.0-rc

2024-03-03

最后,App Service 可以在 Linux 容器下的 .NET 8 Preview 上运行(尚不支持 Windows)。我创建了一个并部署了一个简单的应用程序,但容器没有启动,如下所示:

2023-09-17T20:25:27.314076959Z The following frameworks were found:
2023-09-17T20:25:27.314080459Z   8.0.0-preview.7.23375.6 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
2023-09-17T20:25:27.314084859Z
2023-09-17T20:25:27.314088060Z Learn more:
2023-09-17T20:25:27.314103160Z https://aka.ms/dotnet/app-launch-failed
2023-09-17T20:25:27.314106760Z
2023-09-17T20:25:27.314110060Z To install missing framework, download:
2023-09-17T20:25:27.314113460Z https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.0-rc.1.23419.4&arch=x64&rid=linux-x64&os=debian.12
2023-09-17T20:25:28.143Z ERROR - Container mytestsite_0_6514069e for site mytestsite has exited, failing site start
2023-09-17T20:25:28.165Z ERROR - Container mytestsite_0_6514069e didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2023-09-17T20:25:28.168Z INFO  - Stopping site mytestsite because it failed during startup.

应用程序日志中的类似内容(尽管全部显示为绿色,“确定”):

2023-09-17T20:05:29.1782264 Trying to find the startup DLL name...
2023-09-17T20:05:29.1785581 Found the startup D name: Test.Api.dll
2023-09-17T20:05:29.1786987 Running the command: dotnet "Test.Api.dll"
2023-09-17T20:05:29.2267788 You must install or update .NET to run this application.
2023-09-17T20:05:29.2268172 App: /home/site/wwwroot/Test.Api.dll
2023-09-17T20:05:29.226821 Architecture: x64
2023-09-17T20:05:29.227199 Framework: 'Microsoft.NETCore.App', version '8.0.0-rc.1.23419.4' (x64)
2023-09-17T20:05:29.227326 .NET location: /usr/share/dotnet/

我替换了参考rc包裹由preview类似的包8.0.0-preview.7.23375.9在我的应用程序中,但它没有帮助,同样的错误。

我想知道是否可以手动将 8.0.0-rc.1.23419.4 安装到 Linux 计算机上,以及为什么它会要求它,因为 Visual Studio 项目文件中没有声明直接依赖项。在发布过程中创建了一个名为 Test.Api.runtimeconfig.json 的文件,它指向 8.0.0-rc,但我不确定它是如何在文件内创建和管理的:

      {
        "name": "Microsoft.AspNetCore.App",
        "version": "8.0.0-rc.1.23421.29"
      }

我认为有两种方法可以修复它:1)手动将 8.0.0-rc 安装到 Linux 机器上,或者 2)以某种方式更新 github yml 脚本,以指示它在构建操作之前将特定版本的 .net 安装到 Linux 机器上


当我尝试部署我的示例时.NET 8 web app to Linux Azure App Service(.NET8)通过visual studio,我面临着同样的问题。

尝试以下步骤来修复此错误:

  • 在 Visual Studio 中打开您的项目,右键点击 on the Project solution=> Publish.
  • Create 发布个人资料将项目部署到Azure通过选择您的.NET8 Linux Azure 应用服务.
  • 在发布个人资料之前,请单击Show all settings:

更改部署模式依赖于框架 to 独立的:

发布个人资料:

回复:

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

.net 8 预览版 Linux 上托管的 Azure 应用服务无法启动,显然要求安装 8.0.0-rc 的相关文章

随机推荐