Cannot start .Net Core based on project.json after installing VS 2017

I worked on the software for a while and always did it using the dotnet run. Today I decided to install VS 2017, and after that (still not quite sure if this is the main reason), I can no longer run my software.

The existing project is nowhere close to the project that I opened with VS 2017, so the only collision I suspect may be due to a change in the kernel version. Of course, I restarted the installation from the page, the latest version.

dotnet --version
1.0.0-preview4-004233

I notice that when I execute dotnet new, the directory receives the xxx.csproj file, not project.json, and I read somewhere that MS is about to abandon it.

What can I do to start a previous project? I was kind of stuck in the middle of everything, and googling gave me nothing. Apparently, I'm the first dude to do this stupid update (if that's because of this for starters).

+5
source share
1 answer

What can I do to start a previous project again?

Add a global.json to your project or solution root directory with an SDK property pointing to the previous SDK. For instance:

 { "sdk": { "version": "1.0.0-preview2-003131" } } 

View the SDK versions that you installed as follows:

 PS> dir 'C:\Program Files\dotnet\sdk\' -name 1.0.0-preview2-003131 1.0.0-preview2-003133 1.0.0-preview2-003156 1.0.0-preview2-1-003177 1.0.0-preview3-004056 

Anything that has a value of preview2 will use project.json , anything that has a value of preview3 (or higher) will use xxx.csproj .

See also : Declaration of Basic .NET Tools MSBuild "alpha" > Install side by side.

+5
source

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


All Articles