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

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

问题描述

安装 Visual Studio 2017 Professional 后,我无法再在 Visual Studio 2015 Professional 中构建我的 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 中使用的任何 .net 框架版本的错误消息,并且存在于 C:Program Filesdotnetsdk 文件夹

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 Filesdotnetsdk folder

错误 MSB4019 导入的项目C:Program FilesdotnetsdkX.X.XMicrosoftVisualStudiov14.0DotNetMicrosoft.DotNet.Props"没有找到.确认声明中的路径正确,并且该文件存在于磁盘上.

Error MSB4019 The imported project "C:Program FilesdotnetsdkX.X.XMicrosoftVisualStudiov14.0DotNetMicrosoft.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天全站免登陆