.NET Core: How to use csproj based projects with project.json?

Is there a (preferably convenient) way to create a C # project, so that it uses both the project.json format introduced with .NET Core and the traditional csproj project file? If so, how?

I'm curious because this is similar to what they are doing in the CoreFX repository instead of using the xproj format that Visual Studio generates.

+7
c # asp.net-core .net-core dnx
source share
1 answer

Yeah! Looks like I found the answer in Visual Studio.

Instead of creating a Class Library (Package) project (which might be tempted by the bright blue icon), just create a regular PCL:

When prompted for the platforms you want to target, simply enable ASP.NET Core 5.0 as one of them:

Then Visual Studio will automatically generate the csproj and project.json files for you, and you can live happily ever after not having (God forbid) write your own csproj file.

Detailed instructions can be found here in the CoreFX repository.

+5
source share

All Articles