[Bug 2089686] Re: NET 9 SDK targets NET 8.0.11 for NET 8 projects
Dominik Viererbe
2089686 at bugs.launchpad.net
Fri Nov 29 15:00:43 UTC 2024
Hello, thank you for reporting this bug and helping to improve Ubuntu!
I could replicate the behavior you reported. I executed the following commands in an Ubuntu 24.10 (Oracular Oriole) LXD container:
$ apt update
$ apt install dotnet8
$ dotnet --info # shows only .NET Runtime 8.0.10 / SDK 8.0.110 is installed
$ dotnet new console --output HelloWorld
$ cd HelloWorld
$ apt install dotnet9
$ dotnet --info # shows .NET Runtime 8.0.10 & 9.0.0 / SDK 8.0.110 & 9.0.100 is installed
$ cat HelloWorld.csproj # shows <TargetFramework>net8.0</TargetFramework>
$ dotnet publish
$ dotnet bin/Release/net8.0/publish/HelloWorld.dll
> You must install or update .NET to run this application.
>
> App: /root/HelloWorld/bin/Release/net8.0/publish/HelloWorld.dll
> Architecture: x64
> Framework: 'Microsoft.NETCore.App', version '8.0.11' (x64)
> .NET location: /usr/lib/dotnet/
>
> The following frameworks were found:
> 8.0.10 at [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
> 9.0.0 at [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
>
> Learn more:
> https://aka.ms/dotnet/app-launch-failed
>
> To install missing framework, download:
> https://aka.ms/dotnet-core-applaunch?> framework=Microsoft.NETCore.App&framework_version=8.0.11&arch=x64&rid=ubuntu.24.10-x64&os=ubuntu.24.10
Unfortunately `dotnet publish` binds to the latest published runtime according to
https://learn.microsoft.com/en-us/dotnet/core/versions/selection#self-contained-deployments-include-the-selected-runtime
You can (for the moment) work around this when you
1) either instruct .NET to select the .NET 9 runtime with
$ dotnet --roll-forward Major bin/Release/net8.0/publish/HelloWorld.dll
2) or install dotnet8 from the -proposed pocket. See https://wiki.ubuntu.com/Testing/EnableProposed how to do that.
> Please include 8.0.11 package as soon as possible to remedy the issue.
We already uploaded the latest version on release day, unfortunately it has not yet left the -proposed pocket yet; see: LP: #2087882
** Changed in: dotnet8 (Ubuntu)
Status: New => Confirmed
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dotnet8 in Ubuntu.
https://bugs.launchpad.net/bugs/2089686
Title:
NET 9 SDK targets NET 8.0.11 for NET 8 projects
Status in dotnet8 package in Ubuntu:
Fix Committed
Bug description:
WHen using the new NEW 9 SDK for NET 8 projects the compilation targets the 8.0.11 runtime.
So currently without this package NET 9 is unusable for projects not yet migrated to NET 9 (as only 8.0.10 is available).
Please include 8.0.11 package as soon as possible to remedy the issue.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dotnet8/+bug/2089686/+subscriptions
More information about the foundations-bugs
mailing list