sdk icon indicating copy to clipboard operation
sdk copied to clipboard

The specified framework 'Microsoft.NETCore.App', version '2.1.1' was not found after the SDK is uninstalled

Open JanFredrikD opened this issue 8 years ago • 29 comments

Steps to reproduce

You need to already have the Microsoft.NETCore.App 2.1.0 SDK installed with a web project with the versionless Microsoft.AspNetCore.App in the .csproj.

Install the Microsoft.NETCore.App 2.1.1 SDK and debug your project. I got it from here: https://github.com/dotnet/versions/tree/7a833dddfddc27f2074b755b94234a25b9757637/build-info/dotnet/product/cli/release

Uninstall the Microsoft.NETCore.App 2.1.1 SDK.

Debug the web project again.

Expected behavior

Should run with version 2.1.0.

Actual behavior

Getting the following error message when debugging: It was not possible to find any compatible framework version The specified framework 'Microsoft.NETCore.App', version '2.1.1' was not found. The following versions are installed: 2.1.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

I tried with a repair on the 2.1.0 SDK, reboot, all changes are rolled back from the source control. I cannot see a reference to the 2.1.1 version anywhere. Where does it think that I should target 2.1.1 after I have uninstalled it?

Environment data

dotnet --info output: .NET Core SDK (reflecting any global.json): Version: 2.1.300 Commit: adab45bf0c

Runtime Environment: OS Name: Windows OS Version: 6.1.7601 OS Platform: Windows RID: win7-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.300\

Host (useful for support): Version: 2.1.0 Commit: caa7b7e2ba

.NET Core SDKs installed: 1.0.0-preview1-002702 [C:\Program Files\dotnet\sdk] 1.0.0-preview2-003121 [C:\Program Files\dotnet\sdk] 1.0.0-preview2-003131 [C:\Program Files\dotnet\sdk] 1.0.0 [C:\Program Files\dotnet\sdk] 1.0.2 [C:\Program Files\dotnet\sdk] 1.0.3 [C:\Program Files\dotnet\sdk] 1.0.4 [C:\Program Files\dotnet\sdk] 1.1.0 [C:\Program Files\dotnet\sdk] 2.0.0 [C:\Program Files\dotnet\sdk] 2.0.2 [C:\Program Files\dotnet\sdk] 2.0.3 [C:\Program Files\dotnet\sdk] 2.1.2 [C:\Program Files\dotnet\sdk] 2.1.4 [C:\Program Files\dotnet\sdk] 2.1.100 [C:\Program Files\dotnet\sdk] 2.1.101 [C:\Program Files\dotnet\sdk] 2.1.102 [C:\Program Files\dotnet\sdk] 2.1.103 [C:\Program Files\dotnet\sdk] 2.1.104 [C:\Program Files\dotnet\sdk] 2.1.200 [C:\Program Files\dotnet\sdk] 2.1.201 [C:\Program Files\dotnet\sdk] 2.1.300 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.0-rc2-3002702 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

JanFredrikD avatar Jun 20 '18 09:06 JanFredrikD

I fixed it now. The .NET Core Runtime of Microsoft.AspNetCore.App 2.1.1 was still installed, so I deleted the following folder: C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\2.1.1

JanFredrikD avatar Jun 20 '18 16:06 JanFredrikD

Was it just the folder that was there or were all the contents for it there as well?

livarcocc avatar Jun 20 '18 17:06 livarcocc

All the content was there as well.

JanFredrikD avatar Jun 20 '18 17:06 JanFredrikD

It also worked if I renamed the folder to 0.1.1

JanFredrikD avatar Jun 20 '18 18:06 JanFredrikD

yeah getting the error also updating AspNetCore.All to latest. Following the link in output http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409

I uninstalled / reinstalled 2.1.300 . Though my folder is is 2.1.0. Going to try rename trick @JanFredrikD mentioned

Also I used SDK

sonicdivx avatar Jun 21 '18 13:06 sonicdivx

Ran into this problem too. I installed the latest SDK - 2.1 SDK (v2.1.300) and updated the package Microsoft.AspNetCore.App to v2.1.1

When running dotnet run, I get The specified framework 'Microsoft.AspNetCore.App', version '2.1.1' was not found. ...

  • The following versions are installed: 2.1.0 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]

The following is installed on my machine:

  • Microsoft .NET Core SDK 2.1.300 (x64)
  • Microsoft .NET Core Runtime - 2.1.0 (x64)

and under the Program Files\dotnet\shared folder I have 2.1.0 folders everywhere

  • Microsoft.AspNetCore.All -- 2.1.0
  • Microsoft.AspNetCore.App -- 2.1.0
  • Microsoft.NETCore.App -- 2.1.0

tstojecki avatar Jun 21 '18 16:06 tstojecki

@tstojecki how did you update the package? did the NuGet package manager offer you to update the package reference?

The idea is that you don't specify the version of the package in the project file and let the tooling choose a version for you:

<Project Sdk="Microsoft.NET.Sdk.Web">
…
<ItemGroup>
   <!--  No Version needed -->
  <PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>

dasMulli avatar Jun 21 '18 17:06 dasMulli

@dasMulli That makes sense, but (and I did not create the project I am working in) I wonder if it gets assigned when create the project if not using the current releases.

sonicdivx avatar Jun 21 '18 18:06 sonicdivx

@dasMulli Yes, the NuGet package manager suggested the update to 2.1.1.

What did it for me was installing this specific version https://github.com/dotnet/versions/tree/7a833dddfddc27f2074b755b94234a25b9757637/build-info/dotnet/product/cli/release/2.1.1

I am confused though, installing the .NET Core 2.1 SDK (v2.1.301) from https://www.microsoft.com/net/download/windows

appears to be installing 2.1.0 framework files under program files/dotnet/shared Microsoft.AspNetCore.All -- 2.1.0 Microsoft.AspNetCore.App -- 2.1.0 Microsoft.NETCore.App -- 2.1.0

which creates an issue when the microsoft.aspnetcore.app package is updated to 2.1.1.

Installing 2.1.1 build from the github link above installs the proper files under

Microsoft.AspNetCore.All -- 2.1.0 -- 2.1.1 Microsoft.AspNetCore.App -- 2.1.0 -- 2.1.1 Microsoft.NETCore.App -- 2.1.0 -- 2.1.1

So installing 2.1.301 of SDK from the official download page is not enough to run with microsoft.aspnetcore.app 2.1.1?

tstojecki avatar Jun 21 '18 20:06 tstojecki

@tstojecki so https://download.microsoft.com/download/D/0/4/D04C5489-278D-4C11-9BD3-6128472A7626/dotnet-sdk-2.1.301-win-x64.exe for me installed 2.1.1 version of all shared frameworks. which exact installer did you use?

Please don't use a fixed version from NuGet as mentioned above.

@JunTaoLuo @natemcmaster is the websdk supposed to set properties to disallow the package manager to offer updates to the sharedfx packages? Maybe this should be made even stricter, possibly even emit a build warning if a package version is set by the user.

dasMulli avatar Jun 21 '18 20:06 dasMulli

The current implementation only sets the property to disallow package manager from offering updates when there is no explicit version set on the Microsoft.AspNetCore.App package dependency. If you specify an explicit version, we no-op all of our implicit logic. Is the proposal to add a warning when explicit versions are specified on references to the aspnet metapackages?

JunTaoLuo avatar Jun 22 '18 03:06 JunTaoLuo

@JunTaoLuo yes that's the proposal. Opened https://github.com/aspnet/websdk/issues/369 to properly track/discuss it.

dasMulli avatar Jun 22 '18 04:06 dasMulli

When you install the SDK for 2.1.1, it also installs the 2.1.1 runtime for both .NET Core and ASP.NET Core. When you uninstall the SDK, it does not remove the runtime. The issue is that Visual Studio does not check for the highest SDK version when debugging, it also checks for the highest runtime version. I think it would be more correct to only use for the highest SDK version, and instead give a warning that you have a higher runtime version.

JanFredrikD avatar Jun 22 '18 05:06 JanFredrikD

I installed the 2.1.1 SDK today, but had to do a repair as the 2.1.1 folder that I had deleted earlier was not created during the regular install.

JanFredrikD avatar Jun 22 '18 14:06 JanFredrikD

@JunTaoLuo any idea why the 2.1.1 runtime of asp.net would not have been removed when removing the SDK? That would have been my expectation.

livarcocc avatar Jun 22 '18 17:06 livarcocc

I believe the installers will do some sort of ref-counting and the runtime installer is a sub-installer of the SDK. so if you remove a folder and the MSI it is associated with is still installed, the folder won't be recreated.

dasMulli avatar Jun 22 '18 18:06 dasMulli

I'm getting the same error from a brand new project using the latest v2.1.301 from the downloads page. I eventually uninstalled the sdk and rolled back to v2.1.300 and everything is working again. Something weird is going on with the latest installer.

MarcusChamberlain avatar Jun 23 '18 03:06 MarcusChamberlain

@MarcusChamberlain what exactly is the error? was it the result of a project created with dotnet new or through VS? can you upload the problematic project?

dasMulli avatar Jun 23 '18 03:06 dasMulli

Project is attached. It was created through Visual Studio 15.7.4. One thing I noticed while setting this up is it's only the Docker version that seems to be breaking (for me at least) in 2.1.301. If I run the app outside of Docker in IIS Express it works fine. Maybe something going on with the docker hub images?

TestWebApp.zip

The full error is:

It was not possible to find any compatible framework version
The specified framework 'Microsoft.AspNetCore.App', version '2.1.1' was not found.
- Check application dependencies and target a framework version installed at:
/usr/share/dotnet/
- Installing .NET Core prerequisites might help resolve this problem:
http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
- The .NET Core framework and SDK can be installed from:
https://aka.ms/dotnet-download
- The following versions are installed:
2.1.0 at [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.

MarcusChamberlain avatar Jun 23 '18 04:06 MarcusChamberlain

looks like you have an outdated version of the base image on your machine. can you do a

docker pull microsoft/dotnet:2.1-aspnetcore-runtime

and see if it pulls a newer version? then try rebuilding your image.

dasMulli avatar Jun 23 '18 05:06 dasMulli