安装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核心1.0.1吗?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40851326/

10-09 02:26