I've been working on a software for a while and always executed it using dotnet run. Today, I decided to install VS 2017 and after that (still not entirely sure if it's the root cause, though), I can't run my software anymore.
The pre-existing project is nowhere near the project I opened with VS 2017 so the only collision I suspect might be due to the Core version being changed. To be sure, I re-ran 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 get a xxx.csproj file and not project.json and I've read somewhere that MS is going to drop support for it.
What can I do to get the pre-existing project running again? I'm kind of stuck in the middle of the whole thing and googling gave me precisely nothing. Apparently, I'm the first dude to do this stupid upgrade (if it's because of that to begin with).
The project. json file maintains a list of packages used in a project, known as a package management format. It supersedes packages.
Right click your project and select "Edit ProjectName. csproj" to view the file.
Project. json is an automatically generated file which is included in the folder of each automation project made in Studio. The file holds information about the project dependencies, and web services loaded in libraries.
json file is an application configuration file used to store configuration settings such as database connections strings, any application scope global variables, etc. If you open the ASP.NET Core appsettings. json file, then you see the following code by default which is created by visual studio.
What can I do to get the pre-existing project running again?
Add a global.json
to your project or solution's root directory, with an SDK property that points at the previous SDK. For example:
{
"sdk": {
"version": "1.0.0-preview2-003131"
}
}
View the SDK versions that you have installed like this:
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 with preview2
will use project.json
, anything with preview3
(or above) will use xxx.csproj
.
See also: Announcing .NET Core Tools MSBuild “alpha” > Side by side install.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With