Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net core 如何从.Net Core 2.1 RC1升级到稳定版本的.Net Core 2.1?_Asp.net Core_.net Core_Asp.net Core 2.0 - Fatal编程技术网

Asp.net core 如何从.Net Core 2.1 RC1升级到稳定版本的.Net Core 2.1?

Asp.net core 如何从.Net Core 2.1 RC1升级到稳定版本的.Net Core 2.1?,asp.net-core,.net-core,asp.net-core-2.0,Asp.net Core,.net Core,Asp.net Core 2.0,由于需要SignalR,在5月30日ASP.NETCore2.1的稳定版本发布之前,我已经开始了我的项目,我选择使用ASP.NETCore2.1RC1 但是,一旦稳定版本发布,我自然会放弃预览版本,升级到稳定版本。如何做到这一点 为了实现这一点,我去下载了.NETCore2.1x64安装程序。然而,安装了它之后,我现在无法编译我的项目。编译失败,出现以下错误: NuGet package restore failed. Please see Error List window for detai

由于需要SignalR,在5月30日ASP.NETCore2.1的稳定版本发布之前,我已经开始了我的项目,我选择使用ASP.NETCore2.1RC1

但是,一旦稳定版本发布,我自然会放弃预览版本,升级到稳定版本。如何做到这一点

为了实现这一点,我去下载了.NETCore2.1x64安装程序。然而,安装了它之后,我现在无法编译我的项目。编译失败,出现以下错误:

NuGet package restore failed. Please see Error List window for detailed warnings and errors.
1>------ Build started: Project: mon, Configuration: Debug Any CPU ------
1>C:\Users\m\source\repos\mon\mon\mon.csproj : warning NU1608: Detected package version outside of dependency constraint: Microsoft.CodeAnalysis.CSharp.Workspaces 2.8.0-beta3 requires Microsoft.CodeAnalysis.CSharp (= 2.8.0-beta3) but version Microsoft.CodeAnalysis.CSharp 2.8.0 was resolved.
1>C:\Users\m\source\repos\mon\mon\mon.csproj : error NU1107: Version conflict detected for Microsoft.CodeAnalysis.Common. Reference the package directly from the project to resolve this issue. 
1>C:\Users\m\source\repos\mon\mon\mon.csproj : error NU1107:  mon -> Microsoft.AspNetCore.App 2.1.0 -> Microsoft.AspNetCore.Mvc.Razor 2.1.0 -> Microsoft.CodeAnalysis.CSharp 2.8.0 -> Microsoft.CodeAnalysis.Common (= 2.8.0) 
1>C:\Users\m\source\repos\mon\mon\mon.csproj : error NU1107:  mon -> Microsoft.VisualStudio.Web.CodeGeneration.Design 2.1.0-rc1-final -> Microsoft.VisualStudio.Web.CodeGenerators.Mvc 2.1.0-rc1-final -> Microsoft.VisualStudio.Web.CodeGeneration 2.1.0-rc1-final -> Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore 2.1.0-rc1-final -> Microsoft.VisualStudio.Web.CodeGeneration.Core 2.1.0-rc1-final -> Microsoft.VisualStudio.Web.CodeGeneration.Templating 2.1.0-rc1-final -> Microsoft.VisualStudio.Web.CodeGeneration.Utils 2.1.0-rc1-final -> Microsoft.CodeAnalysis.CSharp.Workspaces 2.8.0-beta3 -> Microsoft.CodeAnalysis.Workspaces.Common 2.8.0-beta3 -> Microsoft.CodeAnalysis.Common (= 2.8.0-beta3).
1>Done building project "mon.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
我该如何解决这个问题


老实说,我目前的想法是从“控制面板”的“程序和函数”中卸载Visual Studio和所有.NET Core SDK条目,然后重新安装,创建一个新的ASP.NET Core项目,将我从旧项目手动编写的所有源文件粘贴到新项目中。。。我想这里一定有更好的方法?

我收到了相同的错误消息。然后,我尝试更新
Microsoft.AspNetCore.App
Microsoft.NetCore.App
NuGet软件包,但没有成功,它告诉我需要删除
Microsoft.VisualStudio.Web.CodeGeneration.Design
参考。这就解决了我的问题


您不需要卸载Visual Studio。只需使用正确的版本重新安装NET Core SDK,并在csproj文件中更新软件包版本。我首先卸载了RC1,然后安装了稳定版本。Visual Studio update似乎没有安装.NET Core SDK。请检查项目中的软件包参考,可能是
Microsoft.VisualStudio.Web.CodeGeneration.Design
的版本硬编码为
2.1.0-rc1-final