.NET完整框架的SDK样式.csproj [英] SDK style .csproj for .NET full framework

查看:94
本文介绍了.NET完整框架的SDK样式.csproj的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道为什么,当创建一个新的.NET完整框架项目时,Visual Studio(版本15.9.2)仍然使用旧样式的.csproj文件吗?

Does anyone know why, when creating a new .NET full framework project, Visual Studio (version 15.9.2) still uses the old style of .csproj file?

为解决这个问题,在创建新的完整框架项目时,我创建了一个.NET核心项目,然后只需将.csproj中的TargetFramework标记编辑为目标net472(例如),从而利用新的简化结构。

To get round this, when creating new full framework projects, I create a .NET core project and then simply edit the TargetFramework tag in the .csproj to target net472 (for example), thereby taking advantage of the new simplified structure.

有人看到这种方法有问题吗?

Does anyone see a problem with this approach?

推荐答案

关于为什么,这是GitHub问题的摘录它(添加对ASP.NET(非核心)项目#2670的支持) ,尽管特定于有关ASP.NET的问题,而不是一般的.NET Framework项目:

As to the why, here's an excerpt from a GitHub issue that covers some of it (Add support for ASP.NET (non-Core) projects #2670), albeit specific to an ask regarding ASP.NET, rather than .NET Framework projects in general:


老实说,我看不到这种情况在短期内(今年)。
在将SDK项目和新的
项目系统带到较早的项目之前,有很多方法可以解决。那些类似
的东西甚至与ASP.NET没有任何关系,因此将ASP.NET东西移植到新的
项目系统中将需要花费
一堆工作这是不平凡的,例如老式剃刀编辑器,aspx
编辑器,webforms设计器??,构建系统(WAP项目具有
msbuild +构建管理器构建系统的混合版本)以及
System.Web所需的任何其他特性。由于较旧的项目系统是本机的,所以其中一些组件是用本机的
代码编写的。

Honestly I don't see this happening in the short term (this year). There are lots of kinks to work out with SDK projects and the new project system before we can bring them to older projects. Those kinks don't even have anything to do with ASP.NET so then there would be a bunch of work that needs to happen to port ASP.NET things to the new project system which is non trivial e.g. old razor editor, aspx editor, webforms designer??, build system (WAP projects have a hybrid msbuild + build manager build system), and any other quirks that System.Web requires. Some of those components are written in native code since the older project system was native.

所有这些说明,这不是简单的切换,这是一组在新的和现有的项目系统上工作的人。当
SDK项目接近完美时,我会考虑将其降级为
项目。

All of this to say, it's not a simple flip the switch, it's the same set of people working on new and existing project systems. When the SDK projects are near flawless, I'd look at bringing it to down level projects.

简短版本:新的项目系统还不够成熟,还无法转移所有内容,因此这绝非易事。

Short version: The new project system isn't mature enough yet to shift over everything, and that won't be a small undertaking when it is.

也有评论在其中,您可以在同一解决方案中混合新旧项目(这对您来说可能不是问题,但对其他人而言值得一提):

There's also commentary in there about issues you can have mixing old and new projects in the same solution (which may not be an issue for you, but is worth mentioning for others):


我们无法移动,因为我们甚至无法开始移动解决方案。我们无法将内容移至新系统上的库并以任何合理的方式迁移,因为构建系统不会同时构建两者。

We can't move because we can't even start to move the solutions. We can't move things to libraries on the new system and migrate over in any reasonable way, because the build system won't build both.

如果它对您有用,那很好,但是它不受支持,而且您肯定会遇到陷阱。

If it works for you, great, but it's not supported and there are definitely pitfalls that you may encounter.

这篇关于.NET完整框架的SDK样式.csproj的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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