简体   繁体   English

安装Visual Studio 2017 RC打破了dotnet核心1.0.1?

[英]Installing Visual Studio 2017 RC breaks dotnet core 1.0.1?

I can no longer build projects that are using .net core 1.0.1, once I install Visual Studio 2017 RC, so it's not as "side by side" as we might have hoped. 一旦我安装了Visual Studio 2017 RC,我就再也无法构建使用.net core 1.0.1的项目了,所以它并不像我们希望的那样“并排”。

When I build I get this error: 当我构建时,我收到此错误:

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.

Update: I have documented a workaround in the comments, but if there's a way to get both preview3 and preview2 tooling to work "side by side" that's what this question is asking. 更新:我已经在评论中记录了一种解决方法,但如果有办法让preview3和preview2工具“并排”工作,这就是这个问题的问题。

The proper way to make sure the right .net core tools gets used is a file called global.json in your solution dir that should reference your desired tools: 确保使用正确的.net核心工具的正确方法是在您的解决方案目录中名为global.json的文件,该文件应该引用您想要的工具:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM