dotnet / core

.NET news, announcements, release notes, and more!
https://dot.net
MIT License
20.87k stars 4.88k forks source link

The framework 'Microsoft.AspNetCore.App', version '6.0.0' (x64) was not found. - No frameworks were found. You can resolve the problem by installing the specified framework and/or SDK. #7087

Closed adammazinga closed 2 years ago

adammazinga commented 2 years ago

[adam@XBA API]$ dotnet run Building... It was not possible to find any compatible framework version The framework 'Microsoft.AspNetCore.App', version '6.0.0' (x64) was not found.

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:

buyaa-n commented 2 years ago

Seems you need to install AspNetCore runtime, hope this would help: https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#install-the-runtime. Please close the issue if it fixes your issue, thanks

janvanveldhuizen commented 2 years ago

How did you solve this? In my case Pacman -Sy dotnet-runtime didnt help

UPDATE: found the solution: Pacman -Sy aspnet-runtime

I leave this comment here for others having the same issue with an Arch based Linux

adammazinga commented 2 years ago

At the time, I rolled back to dotnet 5 dotnetfix And it worked fine for me. You can however install your dotnet version 6 using this script here.

You can edit your shell profile to permanently add the commands. There are several different shells available for Linux and each has a different profile. For example:

Bash Shell: ~/.bash_profile, ~/.bashrc Korn Shell: ~/.kshrc or .profile Z Shell: ~/.zshrc or .zprofile Edit the appropriate source file for you shell and add :$HOME/dotnet to the end of the existing PATH statement. If no PATH statement is included, add a new line with export PATH=$PATH:$HOME/dotnet.

Also add export DOTNET_ROOT=$HOME/dotnet to the end of the file.

AhmedFathyDev commented 2 years ago
# pacmac -S dotnet-sdk dotnet-runtime aspnet-runtime
Bartleby2718 commented 10 months ago

For those of you who are getting this error on a Docker container, perhaps it's because you're using dotnet/runtime when you should be using dotnet/aspnet.

smellahya commented 4 months ago

For those of you who are getting this error on a Docker container, perhaps it's because you're using dotnet/runtime when you should be using dotnet/aspnet.

can I have more details about this please, I have the same error in my docker container :

Starting creatio-dev_app_1 ... done Attaching to creatio-dev_app_1 app_1 | It was not possible to find any compatible framework version app_1 | The framework 'Microsoft.NETCore.App', version '6.0.0' was not found. app_1 | - The following frameworks were found: app_1 | 3.1.32 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] app_1 | app_1 | You can resolve the problem by installing the specified framework and/or SDK. app_1 | app_1 | The specified framework can be found at: app_1 | - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.0&arch=x64&rid=debian.10-x64

Bartleby2718 commented 4 months ago

@smellahya Check the base image you're using. In my case, I had something like

FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base

but it should've been

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
smellahya commented 4 months ago

@smellahya Check the base image you're using. In my case, I had something like

FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base

but it should've been

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base

Here is my Dockerfile :

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base EXPOSE 5000 5002 RUN apt-get update && \ apt-get -y --no-install-recommends install \ libgdiplus \ libc6-dev && \ apt-get clean all && \ rm -rf /var/lib/apt/lists/ /var/cache/apt/ WORKDIR /app COPY . ./ FROM base AS final WORKDIR /app ENV ASPNETCORE_ENVIRONMENT Development ENV TZ US/Eastern ENV COMPlus_ThreadPool_ForceMinWorkerThreads 100 ENTRYPOINT ["dotnet", "Terrasoft.WebHost.dll"]