Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dotnet says "It was not possible to find any compatible framework version" #8670

Closed
Const-me opened this issue Aug 28, 2017 · 11 comments
Closed

Comments

@Const-me
Copy link

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

@Const-me Const-me changed the title Dotnet says Dotnet says "It was not possible to find any compatible framework version" Aug 28, 2017
@gfoidl
Copy link
Member

gfoidl commented Aug 28, 2017

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

@Const-me
Copy link
Author

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

@gfoidl
Copy link
Member

gfoidl commented Aug 28, 2017

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.

@Const-me
Copy link
Author

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?

@gfoidl
Copy link
Member

gfoidl commented Aug 29, 2017

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.

@Const-me
Copy link
Author

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.

@dasMulli
Copy link
Contributor

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

@nguerrera
Copy link
Contributor

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

@cnjimbo
Copy link

cnjimbo commented Dec 12, 2017

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.

@gimzani
Copy link

gimzani commented Dec 28, 2017

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.)

@lukepuplett
Copy link

lukepuplett commented Jun 4, 2019

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" />

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants