简体   繁体   English

无法正确引用当前安装的.NET Core版本

[英]Failing to correctly reference currently installed version of .NET Core

I created the project when I had RC2 installed. 我在安装RC2时创建了项目。 Then when .NET Core 1.0.0 was released, I uninstalled rc2 and installed 1.0.0. 然后,当.NET Core 1.0.0发布时,我卸载了rc2并安装了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. 我将project.lock.json中的所有依赖项从“ 1.0.0-rc2-3002702”更改为“ 1.0.0”,但发生了相同的错误。

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. 接收PMC中的错误:找不到指定的框架'Microsoft.NETCore.App'版本'1.0.0-rc2-3002702'。 - Check application dependencies and target a framework version installed at: C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App -检查应用程序依存关系并确定安装在以下位置的框架版本: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'. 安装了以下版本:1.0.0或者,安装框架版本“ 1.0.0-rc2-3002702”。

I am wondering where else a reference to that version of .NET Core might be stated? 我想知道还有什么地方可以提及该版本的.NET Core?

This is my project.json - http://pastebin.com/wC91swU7 这是我的project.json- http://pastebin.com/wC91swU7

I changed all the dependencies in the project.lock.json 我更改了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. 您应该在project.json文件中更新依赖项版本,然后运行包还原命令-这将重新生成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 工具应从1.0.0-preview1-final更新为1.0.0-preview2-final
    • "Microsoft.AspNet.Identity.EntityFramework" is now Microsoft.AspNetCore.Identity.EntityFrameworkCore “ Microsoft.AspNet.Identity.EntityFramework”现在为Microsoft.AspNetCore.Identity.EntityFrameworkCore
    • why you use Microsoft.AspNet.Identity.Owin ? 为什么使用Microsoft.AspNet.Identity.Owin? Maybe you need Microsoft.AspNetCore.Identity? 也许您需要Microsoft.AspNetCore.Identity?

The solution I found was installing: 我发现的解决方案是安装:

PM> Install-Package Microsoft.EntityFrameworkCore.Tools -Pre PM>安装包Microsoft.EntityFrameworkCore.Tools -Pre

and replace preview1 with preview2 in 并在其中将Preview1替换为Preview2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通知用户.exe适用于比当前安装的.NET更高的版本 - Notify user that .exe is targeted for newer version of .NET than is currently installed .net核心参考与幻影程序集版本冲突 - .net core reference conflict with phantom assembly version 获取错误“'targetFramework'属性当前引用的版本晚于安装的.NET Framework版本” - Getting Error “The 'targetFramework' attribute currently references a version that is later than the installed version of the .NET Framework” .NET Core解决方案设计在参考旧版本库时遇到问题 - .NET Core Solution design having issues with reference to old version libraries 如何从 .NET 框架应用程序以编程方式检查安装在我的机器上的 .NET Core Runtime 版本? - How to programmatically check the .NET Core Runtime version installed on my machine from a .NET Framework app? Azure 管道在 dotnet 构建中失败,需要升级到最新的 .net 核心版本 - Azure Pipeline Failing in dotnet build, need to upgrade to latest .net core version 会话作为.net核心 - session as reference .net core .NET Core 中的 WCF 参考 - WCF reference in .NET Core postharp无法在.net Core上工作 - postsharp is failing to work on .net core 安装了.Net Core最新的SDK,但未找到'Framework'Microsoft.AspNetCore.App',版本'2.1.0' - .Net Core lastest SDK installed but getting 'Framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM