skip to Main Content

I’ve recently upgraded from .net5 to .net6 and in my services (not using aspnet), I am getting this error when it tries to start up.

It was not possible to find any compatible framework version
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.
The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=6.0.0&arch=x64&rid=debian.11-x64

This is being deployed using docker and the image is built to use the runtime:6.0 like this:

FROM mcr.microsoft.com/dotnet/runtime:6.0 AS service
WORKDIR /app
COPY --from=build-env /app/out/service .
ENTRYPOINT ["dotnet", "MyService.dll"]

Why is the runtime:6.0 image having trouble?

Edit:
I’ve updated my image to use the aspnet:6.0 image instead to run the service. This fixes it but I’m not sure what is requiring the aspnet image vs the regular runtime image.

2

Answers


  1. You are using incorrect runtime image – mcr.microsoft.com/dotnet/aspnet:6.0
    is the one you are looking for:

    FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS service
    WORKDIR /app
    COPY --from=build-env /app/out/service .
    ENTRYPOINT ["dotnet", "MyService.dll"]
    

    UPD

    This fixes it but I’m not sure what is requiring the aspnet image vs the regular runtime image.

    Check for Project tag of .csproj file. If it’s Sdk attribute is set to Microsoft.NET.Sdk.Web then this would be a reason for ASP.NET Core runtime requirement. Also check for libraries referencing Microsoft.AspNetCore.App.

    UPD2

    The last suggestion worked – one of the libraries required ASP.NET Core runtime (MiniProfiler.AspNetCore in this case) to function correctly.

    Login or Signup to reply.
  2. Additional info – .net5.0 is now deprecated and incompatible with .net7. If anyone upgrade their web apps from .net5 to .net6 or .net7, they will need to upgrade the hosting components on their web server as well, which can be download from MS site – ASP.NET Core app to IIS | Microsoft Learn

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search