Push of Dotnet Core App Fails with "**ERROR** Unable to install dotnet-runtime: could not find a version of dotnet-runtime to install"
search cancel

Push of Dotnet Core App Fails with "**ERROR** Unable to install dotnet-runtime: could not find a version of dotnet-runtime to install"

book

Article ID: 392945

calendar_today

Updated On:

Products

VMware Tanzu Application Service

Issue/Introduction

When pushing a Dotnet-Core app, staging fails with the error below.

Downloaded app package (11.1M)
-----> Dotnet-Core Buildpack version 2.4.37
-----> Supplying Dotnet Core
-----> Installing libunwind 1.8.1
.
.
.
-----> Installing dotnet-runtime 8.0.11
Copy [/tmp/buildpacks/####/dependencies/####/dotnet-runtime_8.0.11_linux_x64_any-stack_####.tar.xz]
-----> Finalizing Dotnet Core
[**ERROR** Unable to install dotnet-runtime: could not find a version of dotnet-runtime to install
Failed to compile droplet: Failed to run finalize script: exit status 12

 

Cause

There is a bug in the old buildpack where the TargetFramework can match the following two patterns only. 

  1.  netcoreapp5.0
  2.  netcoreapp5.0-windows

This bug has been fixed since Dotnet-Core Buildpack v2.3.24. More details can be found in this article, https://knowledge.broadcom.com/external/article/298114/push-of-dotnet-core-app-fails-unable-to.html

 

Since Dotnet-Core Buildpack v2.3.24, the matching logic has been updated to pick up more patterns, net(?:coreapp)?(\d\.\d)(?:\w+)?. There are several samples listed below: 

  1. net8.0
  2. net8.0-windows
  3. netcoreapp8.0
  4. netcoreapp8.0-windows

Resolution

Please double-check the settings of "TargetFramework" and make sure the settings matching one of the above four patterns. Here is an example,

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
  <TargetFramework>net8.0</TargetFramework>
  </PropertyGroup>
</Project>