Sdk: Dotnet says "It was not possible to find any compatible framework version"

Created on 28 Aug 2017  Â·  11Comments  Â·  Source: dotnet/sdk

Steps to reproduce

Install VS2017. Create a command-line project. Compile, move to ARM Linux, launch using dotnet xxx.dll

Expected behavior

Should run

Actual behavior

It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.0.0' was not found.

  • Check application dependencies and target a framework version installed at:
    /
  • Alternatively, install the framework version '2.0.0'.

Environment data

dotnet --info output:

Microsoft .NET Core Shared Framework Host

Version : 2.0.1-servicing-25615-03
Build : 715604ad09b5fda1445436977e7032e6d29aa8f5

Most helpful comment

Alright, this is such BS! Why the H can't Microsoft get a rollout right. Roll it out right or roll it back!

Anyways - here's what I had to do to fix this garbage.

1: I had to uninstall all of the .net Core items in the "Programs" section of the control panel.
2: I went to https://github.com/dotnet/core/blob/master/release-notes/download-archive.md and got "2.0 sdk and 2.0 runtime" and installed that.
3: I ran my migration and got the same error as above but the version it was complaining about was "2.0" - SO, I added "2.0.0" to my project and the stupid thing worked.

I hope this works for any one of you - I worked hard enough on this project just to have a "Botched Rollout" reduce it to smoke!

Oh, and another thing - my "data" project borked because the file ".EntityFrameworkCore.targets" was not cleared before it was overwritten. I had 2 ending nodes at the bottom of the file. I hope they fix THAT too.

(Sorry all, I wasted WAY too much time on this SNAFU and it didn't have to happen.)

All 11 comments

Version 2.0.0 is requested, but version 2.0.1-servicing-25615-03 is available (on the rpi, after installing the runtime). It's because only latest can be downloaded.

You have two options:

  • update the runtime-config of your app or via global.js
  • "hack" the runtime /opt/dotnet/** by renaming the folders with version-names to straight 2.0.0

On my rpi I did the latter, because so I don't have to remember the other alternative every time. Althoug the first one would be the correct one.

Edit: the hack

sudo mv /opt/dotnet/host/fxr/2.* /opt/dotnet/host/fxr/2.0.0
sudo mv /opt/dotnet/shared/Microsoft.NETCore.App/2.* /opt/dotnet/shared/Microsoft.NETCore.App/2.0.0

How exactly do I update my runtime-config?

I’ve tried replacing <TargetFramework>netcoreapp2.0</TargetFramework> with <TargetFramework>netcoreapp2.0.1-servicing-25615-03</TargetFramework> in my .csproj.

Visual studio refuses to build saying The TargetFramework value 'netcoreapp2.0.1-servicing-25615-03' was not recognized.

Also tried <TargetFramework>netcoreapp2.0.1</TargetFramework>. Doesn’t build either, The current .NET SDK does not support targeting .NET Core 2.0.1

I mean the runtimeconfig.json in the deploy-output. Search there for your app.

Sorry that I can't give an example right now, here I have only my phone.

PS: VS refuses the build, because in this way the 2.0.1... SDK is neede, which you don't have installed.

I’ve tried adding <RuntimeFrameworkVersion>2.0.1-servicing-25615-03</RuntimeFrameworkVersion> to my .csproj, but it doesn’t build. Neither is <RuntimeFrameworkVersion>2.0.1</RuntimeFrameworkVersion>.

I’ve verified manually patching that xxx.runtimeconfig.json helps, in the sense it changes the error message to a symptom of another, totally different deployment issue.

However, manually patching that json after every build slows down development a lot.

Do you know a way to fix the issue within Visual Studio 2017 build system? Maybe there’s some magic XML element in the .csproj I need to add?

Sorry I don't know any tweak for the build. I can't verify right now, but I remember trying 2.0.* for the version and this didn't work. Therefore I ended up renaming the folders in the runtime. Also the deployment is afterwards easy.

Thanks a lot for your help! Did almost what you said here, and it works now.

Here’s how to fix on Linux’ side without making a copy:

cd /opt/dotnet/shared/Microsoft.NETCore.App/
sudo ln -s ./2.0.1-servicing-25615-03 ./2.0.0

Before running that sudo ln -s make sure you don’t already have the 2.0.0 folder, otherwise you won’t get what you expect.

Also, I hope Microsoft will eventually fix the issue.

Another workaround is to override the version when running on the target system if you build for 2.0.0 and only have a preview runtime installed:

dotnet --fx-version 2.0.1-servicing-25615-03 testapp.dll

This is because the host will not roll apps forward from stable to unstable builds (by design).

See https://github.com/dotnet/core-setup/issues/3072 and the link for downloading a matching 2.0.0 runtime for ARM posted by @Petermarcu

There is the same problem with my project, the workaround to resolve it successfully is that remove the item 'C:\Program Files (x86)\dotnet' from the Path of Environment Variable because I found I did not install the right netcore version under X86. I have not tried to install the proper version with x86, appreciate that you tell me if you have done that test.

Alright, this is such BS! Why the H can't Microsoft get a rollout right. Roll it out right or roll it back!

Anyways - here's what I had to do to fix this garbage.

1: I had to uninstall all of the .net Core items in the "Programs" section of the control panel.
2: I went to https://github.com/dotnet/core/blob/master/release-notes/download-archive.md and got "2.0 sdk and 2.0 runtime" and installed that.
3: I ran my migration and got the same error as above but the version it was complaining about was "2.0" - SO, I added "2.0.0" to my project and the stupid thing worked.

I hope this works for any one of you - I worked hard enough on this project just to have a "Botched Rollout" reduce it to smoke!

Oh, and another thing - my "data" project borked because the file ".EntityFrameworkCore.targets" was not cleared before it was overwritten. I had 2 ending nodes at the bottom of the file. I hope they fix THAT too.

(Sorry all, I wasted WAY too much time on this SNAFU and it didn't have to happen.)

For anyone stumbling on this today, I had this issue on build.

Testhost process exited with error: It was not possible to find any compatible framework version

It was complaining of missing 2.2.5. It listed the installed frameworks which was indeed missing 2.2.5. So I installed the SDK which is 2.2.107 according to its MSI filename and that includes 2.2.5 of the runtime and it builds and no errors in the test output now.

I don't get the version numbers.

I assume Testhost is a process and it wants to run on 2.2.5. Not sure which package the Testhost comes from but I had these referenced. I guess maybe I updated to 2.2.5 package reference but didn't install the SDK (didn't know I had to?)

    <PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.5" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
    <PackageReference Include="MSTest.TestAdapter" Version="1.2.0" />
    <PackageReference Include="MSTest.TestFramework" Version="1.2.0" />
Was this page helpful?
0 / 5 - 0 ratings