Sdk: Failing to correctly reference currently installed version of .NET Core

Created on 1 Jul 2016  路  7Comments  路  Source: dotnet/sdk

I created a project in RC2 then when .NET Core 1.0.0 was released, I uninstalled rc2 and installed 1.0.0. The app is not able to connect to the database. Also the 'Update-Database' command in the Package Manager Console is not executing correctly. I changed all the dependencies in the project.lock.json from '1.0.0-rc2-3002702' to '1.0.0' but the same error occurs.

I am wondering where else a reference to that version of .NET Core might be stated?

Steps to reproduce

  1. Created the project on RC2
  2. Build it and worked on it
  3. Uninstalled RC2 and installed .NET Core 1.0.0 Runtime
  4. Unable to execute successfully 'Update-Database' in the package manager console and unable to connect to the db
  5. Changing the Microsoft.NETCore.App dependencies in project.lock.json file
  6. Same problem

    Expected behavior

Update the database according to the change in the models.

Actual behavior

Receiving an error in PMC:
The specified framework 'Microsoft.NETCore.App', version '1.0.0-rc2-3002702' was not found. - Check application dependencies and target a framework version installed at:
C:\Program Files\dotnet\shared\Microsoft.NETCore.App

  • The following versions are installed:
    1.0.0
  • Alternatively, install the framework version '1.0.0-rc2-3002702'.

Environment data

dotnet --info output:

question

All 7 comments

@SStoyanov1 you shouldn't modify the lock file manually. You should change the versions in you project.json and then do a dotnet restore to generate a new lock file. Can you please share your project.json file?

Check out this video from ASP.NET Community Standup where guys from ASP.NET team updating web site to .NET Core 1.0.0

I had this issue as well, specifically with "dotnet watch run" that I wasn't getting with "dotnet run". The issue was that I was using "1.0.0-*" in my project.json and had installed the tool previously (for a different project) using RC2. Changing to "1.0.0-preview2-final" fixed it.

I also ran into this issue. I cross checked project.json to ensure all references were pointing to 1.0.0. My project.json had these entries

"Microsoft.EntityFrameworkCore": "1.0.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"

The code that generates project.lock.json appears flaky. The project.lock.json file generated continued to point to 1.0.0-rc2-3002702 references.
I resolved this by moving the meat of my web site including the models into a new project and had the project.json created afresh.

Got the same issue.
Reason was the file MyProject.runtimeconfig.json located in MyProject\bin\Debug\netcoreapp1.0 folder which contained a reference to previously used version. Project/solution clean/rebuild won't help. Deleting the file resolved the issue.

Check your global.json file near your .sln.
I had to set the SDK version to 1.1.0

Closing since this should work now.

Was this page helpful?
0 / 5 - 0 ratings