c# - 安装 Visual Studio 2017 RC 会破坏 dotnet core 1.0.1?

标签 c# .net-core visual-studio-2017

安装 Visual Studio 2017 RC 后,我无法再构建使用 .net core 1.0.1 的项目,因此它不像我们希望的那样“并行”。

构建时出现此错误:

D:\dev\app >dotnet build
Microsoft (R) Build Engine version 15.1.0.0
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 11/28/2016 10:35:13 AM.
     1>Project "D:\dev\...\app.xproj" on node 1 (Build target(s)).
     1>D:\dev\..\app.xproj(7,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.0-preview3-004056\Extensions\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was 
not found. Confirm that the path in the <Import> declaration is correct, and 
that the file exists on disk.
     1>Done Building Project "D:\dev\...\app.xproj" (Build target(s)) -- FAILED.

Build FAILED.

更新:我在评论中记录了一个解决方法,但如果有办法让 preview3 和 preview2 工具“并排”工作,这就是这个问题要问的问题。

最佳答案

确保使用正确的 .net 核心工具的正确方法是在您的解决方案目录中创建一个名为 global.json 的文件,该文件应引用您所需的工具:

{
  "projects": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-preview2-003121"
  }
}

关于c# - 安装 Visual Studio 2017 RC 会破坏 dotnet core 1.0.1?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40851326/

相关文章:

c# - Azure 队列 : Unable to read cloud queue messages. AsString 和 AsBytes 属性抛出 System.ArgumentException

asp.net-core - 在 Visual Studio 2017 .NET Core 项目中支持 Roslyn 分析器(.ruleset)

qt - Visual Studio 2017 QT : No default QT version found

c# - 使用 WebAPI 2 进行 JSON.NET 抽象/派生类反序列化

c# - 如何将文本从 OS X 上的 Mono/C# 控制台应用程序复制到剪贴板?

javascript - 如何在 Jint 中使用下划线函数

typescript - 在文件之间拆分 TypeScript 命名空间 - Intellisense 错误

c# - 我们可以在 C#.NET winform 中创建 4 个象限的 3D 图形吗?

c# - 包含路径表达式必须引用在类型上定义的导航属性。

.net-core - Dapper、.NET Core 和事务失败