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
There is a bug in the old buildpack where the TargetFramework can match the following two patterns only.
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:
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>