简体   繁体   中英

Failing to correctly reference currently installed version of .NET Core

I created the project when I had RC2 installed. 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 now. 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.

The error in the Package Manager Console:

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

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

This is my project.json - http://pastebin.com/wC91swU7

I changed all the dependencies in the project.lock.json

  1. You have edited wrong file. You should update dependencies versions in project.json file and then run package restore command - this will regenerate project.lock.json.

  2. Recheck your dependency list. At least I see the following problems

    • tools should be updated from 1.0.0-preview1-final to 1.0.0-preview2-final
    • "Microsoft.AspNet.Identity.EntityFramework" is now Microsoft.AspNetCore.Identity.EntityFrameworkCore
    • why you use Microsoft.AspNet.Identity.Owin ? Maybe you need Microsoft.AspNetCore.Identity?

The solution I found was installing:

PM> Install-Package Microsoft.EntityFrameworkCore.Tools -Pre

and replace preview1 with preview2 in

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM