FelipeFonsecabh
FelipeFonsecabh

Reputation: 187

Can I run a .NET 6.0 service with .NET 8.0 runtime?

I developed a .NET 6.0 app. The computer (raspberry 3) where this service will run has .NET 8.0 runtime.

When I try to run the application with dotnet service.dll, this message appears:

You must install or update .NET to run this application.

App: /home/stationpi/Rpi3Gateway/RpiGateway.dll
Architecture: arm
Framework: 'Microsoft.NETCore.App', version '6.0.0' (arm)
.NET location: /opt/dotnet/

The following frameworks were found:
8.0.3 at [/opt/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=6.0.0&arch=arm&rid=linux-arm&os=raspbian.11

I can't run services developed in previous version of .NET Core?

Obs: the strangest thing is that when I published the same code for linux-arm64 (raspberry 4), this problem didn't happen

Upvotes: 3

Views: 6630

Answers (3)

user326608
user326608

Reputation: 2548

for anyone else like me needing to get an old net6 project running on an ubuntu box with net8:

sudo add-apt-repository ppa:dotnet/backports

sudo apt-get install aspnetcore-runtime-6.0

Upvotes: 0

user23838341
user23838341

Reputation:

if you are talking about dotnet core then you can run the services of .Net 6.0 with .Net 8.0 you just have to install the .Net 8.0 necessary SDK and after that follow these steps:

  1. find bin and obj folder in the project directory.
  2. delete the both folder bin and obj.
  3. run the command dotnet clean and dotnet build in your VScode if your using another IDE then clean and build your project accordingly.
  4. run the project by dotnet run command if any issue persist then run the code in debug mode and resolve it accordingly.

Upvotes: 0

FelipeFonsecabh
FelipeFonsecabh

Reputation: 187

I understood my mistake. In the linux-arm64 publish settings I selected the "Deployment mode" option as "Self-Contained".

When I created another profile, I set this option to "Framework-dependent", which is why when running, it questioned version 6.0.0 of dotnet core.

Upvotes: 1

Related Questions