.NET的核心:如何使用基于的csproj项目旁边project.json? [英] .NET Core: How to use csproj-based projects alongside project.json?

查看:342
本文介绍了.NET的核心:如何使用基于的csproj项目旁边project.json?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个(最好是方便)的方式来建立一个C#项目,使得它同时使用的 project.json与.NET的核心,和传统的csproj项目文件出台基于格式?如果是这样,怎么样?

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

我很好奇,因为它似乎这是他们在的 CoreFX 回购,而不是使用由Visual Studio生成基于xproj格式。

I'm curious because it appears this is what they do in the CoreFX repo, instead of using the xproj-based format that is generated by Visual Studio.

推荐答案

啊哈!它看起来像我找到了答案由我在Visual Studio中。

Aha! It looks like I found the answer by myself in Visual Studio.

而不是创建一个类库(包)项目(可能是诱人因为华而不实的蓝色图标),只需创建一个普通PCL:

Instead of creating a Class Library (Package) project (which may be tempting because of the flashy blue icon), just create a regular PCL:

当系统提示输入您要的目标平台,只需包括 ASP.NET 5.0的核心其中之一:

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

然后Visual Studio将自动生成两个的csproj和project.json文件给你,你可以过上幸福的生活,而不必(上帝保佑)写自己的csproj文件。

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

完整说明,可以发现这里在CoreFX回购。

Full instructions can be found here on the CoreFX repo.

这篇关于.NET的核心:如何使用基于的csproj项目旁边project.json?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆