Home > Software design >  The framework 'Microsoft.AspNetCore.App', version '6.0.0' (x64) was not found
The framework 'Microsoft.AspNetCore.App', version '6.0.0' (x64) was not found

Time:07-01

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.

CodePudding user response:

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.

  • Related