如何在 VS2017/2015 中打开 .xproj 文件

How to open .xproj file in VS2017/2015

我有一个扩展名为 .xproj 的 .NET 核心项目。 当我在 VS 2017 中打开项目时,项目文件 .xproj migrated to .csproj.

如何打开.xproj文件Visual studio 2017 / 2015?

我需要安装什么工具吗?

当我尝试在 VS2015 中打开 xproj 时。它给出错误 The imported project "C:\Program Files (x86)\MSBuild\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. 如前所述,project.json 和 .xproj 已被弃用,不再受 Microsoft 支持。 VS 2017 可以迁移在 VS 2017 中创建的解决方案,从命令行也可以 运行 dotnet migrate

  2. 有一种方法可以继续使用项目。json/xproj 在 VS 2015(仅 2015)中,通过在解决方案目录中创建一个 global.json 文件并设置值sdk->version 到已安装的 preview2 cli 的版本(与版本完全匹配的文件夹必须存在于 C:\Program Files\dotnet\sdk 中,否则您会收到错误消息 Microsoft.‌​DotNet.Props was not found)。有关详细信息,请参阅 https://github.com/dotnet/cli/blob/rel/1.0.1/Documentation/ProjectJsonToCSProj.md#how-do-i-work-with-projectjson-and-csproj-on-the-same-machine