53

I make a project by

File -> New -> Project -> Visual C# -> Web -> ASP.NET Core Web Application     
(.NET Core) -> Empty -> OK

But there is no solution and src directory and also no project.json and web.config etc.

I reference a book that uses Visual Studio 2015. The book's example has all files and directories I told. But I don't(I'm using VS 2017 since I can't find .NET Core for VS 2015).

How can I make those files and directories ?? Do I make these by manually?

ArunPratap
  • 4,816
  • 7
  • 25
  • 43
wallah
  • 1,964
  • 5
  • 27
  • 48

2 Answers2

83

The .NET Core was changing its internals with a slightly fast pace (although it seems it has settled down now), thus making many of the tutorials out there obsolete. Since mid-2016, the project.json has been dumped in favor of "your-app-name".csproj file.

If you are following a tutorial or a book, then for anything you are supposed to write in the project.json, you must now write it in the csproj file with a slightly different format.

If I have to mess with project.json when following tutorials, I use this official migration guide.

Pang
  • 9,564
  • 146
  • 81
  • 122
Sharky
  • 6,154
  • 3
  • 39
  • 72
  • Oh ! I'll remember that ! and, plus in my solution, there is also no *.csproj file... I can't find... can you help me find it?? – wallah Mar 14 '17 at 07:31
  • 2
    @wallah look in the actual directory via windows explorer, not from within visual studio. – Sharky Mar 14 '17 at 07:48
33

The .NET Core (and other teams) have decided to drop project.json and go back to MSBuild and *.csproj.

So there is no project.json nor global.json in .net core stack any more.
The alternative for project.json is *.csproj and for global.json is *.sln.

Old csproj to new csproj: Visual Studio 2017 upgrade guide
for more info


Update: (based on Stajs comment)
global.json is still in the stack, but neutered to only defining the SDK version.

Søren
  • 6,517
  • 6
  • 43
  • 47
  • Its a bad news :( – nim Dec 28 '17 at 17:44
  • 5
    Correction: [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) is still in the stack, but neutered to only defining the SDK version. – Stajs Jan 10 '18 at 01:26
  • @Stajs, After upgrading to v15.4.4 of CLI tools you can defined SDK version in a Project property group : ` netcoreapp2.0 2.0.3 ` – Søren Jan 17 '18 at 13:55
  • 1
    @Soren, the way I read [the docs](https://learn.microsoft.com/en-us/dotnet/core/tools/csproj), neither of those properties are the SDK version. I'm pretty sure everyone understands `` by now. `` is the runtime and independent of SDK, e.g. [SDK 2.1.3 includes runtime 2.0.4](https://imgur.com/a/TAzQ3). Potentially helpful [SO](https://stackoverflow.com/questions/46778064/whats-the-difference-between-targetframework-and-runtimeframeworkversion) and [GitHub](https://github.com/aspnet/IISIntegration/issues/368) discussions. – Stajs Jan 18 '18 at 09:49