7

I am having a .NET core Project with extension .xproj. When I open the project in VS 2017, the project file .xproj migrated to .csproj.

How to open the .xproj file Visual studio 2017 / 2015?

Do I need to install any tools?

When I tried to open the xproj in VS2015 . It gives the error 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.

Do I need to install any tools?

Saravana Kumar
  • 3,669
  • 5
  • 15
  • 35
  • 1
    Then you have VS2017 not VS2015. VS2015 doesn't support ASP.NET Core/NetStandard/.NETCore with csproj – Tseng Apr 28 '17 at 11:25
  • I have also opened the .xproj in vs 2017, but it is converting to .csproj. – Saravana Kumar Apr 28 '17 at 11:26
  • 1
    Yes, because the Tools for VS2017 support the new (slink) csproj structure. VS2015 **doesn't support it**, so you can't receive migrations dialog in VS2015. You must have accidentally opened it in VS2017 – Tseng Apr 28 '17 at 11:28
  • @Tseng I need to open the .xproj file without migration in 2017 or 2015. Can you please tell me how to do so – Saravana Kumar Apr 28 '17 at 11:29
  • VS2017 doesn't support xproj anymore neither will any future version of ASP.NET Core/.NETCore/.NETStandard. If you want to use xproj you have to stay at VS2015 or open it as folder (File -> Open -> Folder ...), but this won't use any settings specified in xproj/sln file iirc. If you really need to continue to work with .xproj, then stay with VS2015 – Tseng Apr 28 '17 at 11:31
  • 3
    xproj is no longer supported anyway, why would you want to stick with it? – DavidG Apr 28 '17 at 11:36
  • Could you kindly advice how to open .xproj file in VS2015. Do I need to install any tools? When I tried to open the xproj in VS2015 . It gives the error 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 declaration is correct, and that the file exists on disk. – Saravana Kumar Apr 28 '17 at 11:37
  • https://www.microsoft.com/net/download/core#/sdk contains all you need, including VS2015 tools – Tseng Apr 28 '17 at 11:45
  • Drop VS2015 and only use VS2017. – Lex Li Apr 28 '17 at 12:19

1 Answers1

12
  1. As already discussed, project.json and .xproj are deprecated and no longer supported by Microsoft. VS 2017 can migrate a solution that has been created in VS 2017, as can running dotnet migrate from the command line.

  2. There is a way to continue working with project.json/xproj in VS 2015 (only 2015), by creating a global.json file in your solution directory and setting the value of sdk->version to the version of the installed preview2 cli (A folder matching the version exactly has to exist in C:\Program Files\dotnet\sdk or else you get the error message Microsoft.‌​DotNet.Props was not found). See 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 for more details.

Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217