Visual Studio 2017安装中断Visual Studio 2015 ASP.NET Core项目 [英] Visual Studio 2017 install breaks Visual Studio 2015 ASP.NET Core Projects

查看:90
本文介绍了Visual Studio 2017安装中断Visual Studio 2015 ASP.NET Core项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装Visual Studio 2017专业版后,我无法再在Visual Studio 2015专业版中构建ASP.NET Core。我从未在VS2017中打开该项目

After installing Visual Studio 2017 Professional I can't build my ASP.NET Core in Visual Studio 2015 Professional anymore. I never opened this project in VS2017

我得到


发生以下错误尝试运行项目模型服务器进程(1.0.0-preview3-004056)。

The following error occured attempting to run the project model server process (1.0.0-preview3-004056).

无法启动该进程。找不到与命令dotnet-projectmodel-server匹配的可执行文件

Unable to start the process. No executable found matching command dotnet-projectmodel-server

然后我在Visual Studio 2015中创建了一个全新的ASP.NET Core项目,加载项目时得到的消息完全相同。

I then created a brand new ASP.NET Core project in Visual Studio 2015 and I get the exact same message when loading my project.

另外,当我要构建项目时,我得到

Additionally when I want to build the project I get


MSB1009:项目文件不存在。

MSB1009: Project File does not exist.

ASP.NET不会发生相同的问题5个项目,因此仅限于ASP.NET Core

The same problem does not occur with ASP.NET 5 projects so It's only limited to ASP.NET Core

Visual Studio 2017 3月7日更新

如果像下面的答案中那样添加了global.json,在 global.json 中使用的并且在 C中存在的任何.net框架版本的n错误消息:C:\Program Files\dotnet\ sdk\ 文件夹

Ifa global.json is added like in the answers below get an error message for any .net framework version used in the global.json and that exist in the C:\Program Files\dotnet\sdk\ folder


错误MSB4019导入的项目 C:\Program Files\dotnet\找不到sdk\XXX\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props。确认声明中的路径正确,并且文件在磁盘上。

Error MSB4019 The imported project "C:\Program Files\dotnet\sdk\X.X.X\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

另外,当关闭Visual Studio并再次将其重新打开时,也会收到原始错误消息

Also when closing Visual Studio and reopening it again I get the original error message

推荐答案

@ClaudioNunes和@MegaTron具有正确答案。阅读该答案后,我意识到我的.NET Core解决方案没有global.json文件。我添加了一个新的解决方案文件夹并添加了global.json文件。由于我的项目都没有嵌套在子文件夹中,因此我只需要从项目数组中删除 src和 test:

@ClaudioNunes and @MegaTron have the correct answer. After reading that answer, I realized my .NET Core solution did not have a global.json file. I added a new solution folder and added a global.json file. Since none of my projects are nested in sub folders, I only had to remove "src" and "test" from the projects array:

{
  "projects": [],
  "sdk": {
    "version": "1.0.0-preview2-003131"
  }
}

现在,该项目可以在安装了VS 2017 RC的VS 2015中正确打开。

The project now opens correctly in VS 2015 with VS 2017 RC installed.

这篇关于Visual Studio 2017安装中断Visual Studio 2015 ASP.NET Core项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆