Reputation: 41
I couldn't find the project.json file in my project, I create new project and I select empty and then I try to enabling ASP.NET core MVC, but I stuck to find a project.json to add this
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0"
},
How I get a project.json to add my code into project.json? BTW I try to study from this tutorial
Upvotes: 1
Views: 1347
Reputation: 26773
Visual Studio 2017 does not support project.json files. To install any package (including MVC) to an existing project, you can do one of the following:
Microsoft.AspNetCore.Mvc
package. See https://learn.microsoft.com/en-us/nuget/tools/package-manager-ui for more details. Repeat for all packages except Microsoft.NETCore.App.Install-Package Microsoft.AspNetCore.Mvc
. See https://learn.microsoft.com/en-us/nuget/tools/package-manager-console for more details. Repeat for all packages except Microsoft.NETCore.App.
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.0" />
</ItemGroup>
All of these are equivalent.
Upvotes: 1