【问题标题】:Pivotal .NetCore 3.1 dotnet-runtime Error During Deployment部署期间的 Pivotal .NetCore 3.1 dotnet-runtime 错误
【发布时间】:2020-12-05 10:36:59
【问题描述】:

我想使用 Bamboo 的 Pivotal 部署我的项目。在部署我的 .NetCore 3.1 项目期间,我收到错误“无法安装 dotnet-runtime:找不到要安装的 dotnet-runtime 版本” .部署堆栈设置为 cflinuxfs3

我尝试在 .csproj 文件中指定 dotnet 运行时版本(3.1 和 3.1.5),但出现相同的错误,因此我将其删除。

我还创建了一个 buildpack.yml 文件,并在其中将 .netcore sdk 版本指定为 3.1.x。

我正在共享来自 csproj 的属性组和 manifest.yml 文件。

-- 错误日志--

正在下载应用程序包...
下载的应用程序包 (6.4M) -----> Dotnet-Core Buildpack 版本 2.3.12
-----> 提供Dotnet Core -----> 安装 libunwind 1.4.0
复制[/tmp/buildpacks/b7bd2a36eb284e204524c677d2dbbfa2/dependencies/a54cfafce3d2a14e4f96777d5fd471f4/libunwind_1.4.0_linux_noarch_cflinuxfs3_05e08b22.tgz] 使用默认 SDK
-----> 安装 dotnet-sdk 3.1.301
复制[/tmp/buildpacks/b7bd2a36eb284e204524c677d2dbbfa2/dependencies/b422801667458a262ba26a3117b93e4f/dotnet-sdk_3.1.301_linux_x64_any-stack_80a771e4.tar.xz]

-----> 安装 dotnet-runtime 3.1.5
复制[/tmp/buildpacks/b7bd2a36eb284e204524c677d2dbbfa2/dependencies/40b5a460524fe7f1795c876445349a31/dotnet-runtime_3.1.5_linux_x64_any-stack_1aa84612.tar.xz]

-----> 完成 Dotnet Core
错误 无法安装 dotnet-runtime:找不到要安装的 dotnet-runtime 版本无法编译 droplet:无法安装 运行 finalize 脚本:退出状态 12 退出状态 223 单元格 ffe536bc-374c-46b5-a620-e3366dab6b22 停止实例 b71ecb48-0083-4fd1-8f59-3a77b05de0e0

错误暂存应用程序:应用程序暂存在 buildpack 编译中失败 阶段

-- .csproj --

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <ServerGarbageCollection>true</ServerGarbageCollection>
    <ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
    <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <NoWarn>$(NoWarn);1591</NoWarn>
  </PropertyGroup>

-- manifest.yml --

---
applications:
- name: projectName
  memory: 1G
  timeout: 240
  instances: 1
  routes:
   - route: routeAddress
  services:
   - ARCHITECTURE.SERVICES-TST.ServiceRegistry
   - ProjectName.Redis
   - ProjectName.Dynatrace
   - ProjectName.ConfigServer
  env:
    DT_TAGS: ((appName)) ((dc))-((env))
    TZ: country
    ASPNETCORE_ENVIRONMENT: environmentName
    SPRING_CLOUD_CONFIG_LABEL: configLabel

【问题讨论】:

  • 如果你能提供一个重现问题的演示应用程序,我会仔细看看,看看我是否可以用更多细节更新我的答案。
  • 我遇到了同样的问题,你能解决这个问题吗?

标签: .net-core asp.net-core-3.1 cloud-foundry .net-runtime


【解决方案1】:

好的,这就是正在发生的事情。

  1. code is looking at the RuntimeFrameworkVersion in your .csproj file

  2. When that is empty, it's going to look at the TargetFramework 并尝试使用正则表达式 netcoreapp(.*) 查找子字符串匹配项。

  3. It is expecting that to have a single match,但在你的情况下它没有,so you get that error message:could not find a version of dotnet-runtime to install

根据您的.csproj 文件,您所拥有的似乎应该没问题。我做了一个快速检查,正则表达式有效并返回了版本。

您可以尝试设置 RuntimeFrameworkVersion,这将采用稍微不同的代码路径,并且可能适合您。

您正在尝试执行source-based deployment。您可以先尝试dotnet publish,然后再尝试Framework Dependent Deployment,这会再次强制使用不同的代码路径。

可能是 buildpack 没有找到您的文件,但如果没有更多信息就很难说。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多