How to open a CLI project in dotnet-core in Visual Studio 2017

I am developing a simple application using dotnet Core (for API) and Angular2 to learn both.

I created a project using Yeoman on the command line , and was happily encoded in Visual Studio Code (on Windows). Everything seems to fit well, and it was a pleasant experience.

It seemed to me that I could try Visual Studio 2017 and see what experience developing a dotnet Core project in VS looks like for a while.

However, having installed VS2017 and cloned a project from github, I am not sure how to do this. I do not see any way to restore / build / start the project.

After cloning the repo, I see that my project appears in the solution explorer with the visible project.json file. However, Debug | The start is highlighted in gray. I read somewhere about VS2017, which needs to convert project.json to the new (old?) XML format, and also I have the feeling that I am missing a .sln file.

I would appreciate it if someone could point me in the right direction.

+6
source share
1 answer

If your project has a .xproj file

  • Open Visual Studio.
  • File> Open> Project / Solution.
  • Open xxx.xproj for your solution.

If your project is missing a .xproj file

  • Install .NET Core SDK Preview 3 or higher .
  • Open a command prompt in the project directory.
  • Run dotnet migrate .
  • Open the resulting .csproj in Visual Studio 2017.

Troubleshooting

View migration help with dotnet migrate -h .

If you have a global.json file, update its SDK version before starting migrate . For instance.

 { "sdk": { "version": "1.0.0-preview4-004233" } } 

View installed SDK versions with dir 'C:\Program Files\dotnet\sdk\' .

Update Visual Studio 2017 and its installer. On my machine the version of Microsoft Visual Studio Community 2017 RC version 15.0.26014.0 D15REL .

Update .NET Core SDK. On my machine above it works with SDK 1.0.0-preview4-004233 .

+2
source

Source: https://habr.com/ru/post/1013666/


All Articles