A quick preamble, I have seen a number of questions with this error already, but in all cases, these were users that were actually attempting to host asp.net core apps using the wrong container. That is not the case in my situation.
I have a working .net core console app hosted in a docker container that was targeting netcoreapp2.1
I started to update it to netcoreapp3.1
by changing the TargetFramework
tag and updating the nuget packages. I also updated the base docker image (.net core runtime) from 2.1 to 3.1.
When I attempt to start this image I get the following error:
It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '3.1.0' 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:
The error message is correct that framework is not installed, but it should be looking for Microsoft.NetCore.App
, which is installed in the container. It seems that is governed by The value of the Sdk
attribute in the Project
element in the csproj file which is <Project Sdk="Microsoft.NET.Sdk">
in this project.
What is causing the runtime to look for the wrong framework dependency?
Sdk="Microsoft.NET.Sdk.Web"
and you can remove anyPackageReference
orFrameworkReference
toMicrosoft.AspNetCore.App
. If it's another type of application, you'll need to add<FrameworkReference Include="Microsoft.AspNetCore.App" />
without a version attribute. Does it work locally BTW? – KnelisMicrosoft.AspNetCore.App
and nothing in visual studio indicates that it is.Microsoft.NetCore.App
should be good enough in this case. – pquestMicrosoft.NetCore.App
either. – Knelis