在.NET Framework上运行.NET Core App [英] Running .NET core App on .NET framework

查看:222
本文介绍了在.NET Framework上运行.NET Core App的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读这篇文章: https://blogs.msdn.microsoft.com/cesardelatorre/2016/06/28/running-net-core-关于在.NET核心应用程序上使用不同的绰号的关于多个框架的应用程序以及目标框架的名字-tfms-是什么/,我想知道创建ConsoleApp和两者之间的区别是什么.NET Framework 4.5.1并创建ConsoleApp .NET Core,并将其昵称设置为.NET Framework 4.5.1.

I was reading this article: https://blogs.msdn.microsoft.com/cesardelatorre/2016/06/28/running-net-core-apps-on-multiple-frameworks-and-what-the-target-framework-monikers-tfms-are-about/ about using different monikers for .NET core app and I was wondering what is the difference between creating ConsoleApp with .NET framework 4.5.1 and creating ConsoleApp .NET core with moniker set to .net framework 4.5.1.

是否期望在行为上有任何差异?我能想到的唯一区别是,第一个将使用csproj,第二个将使用xproj(好,现在不赞成使用xproj,因此使用新的csproj格式).我之所以问这个问题,是因为我当前的应用程序是基于.NET Framework 4.5.1构建的,并且我正在考虑将其迁移至.NET Framework之上的.NET Core.

Is it expected to have any differences in behavior? The only difference I can think of is that the first one will use csproj and the second one will use xproj (ok xproj is deprecated now, so new csproj format). I'm asking this question because my current app is built on top of .NET framework 4.5.1 and I was thinking of migrating it to .NET core on top of .NET framework.

推荐答案

将project.json构建工具称为".NET Core SDK"仅部分正确:这些工具可用于为.NET Core以外的运行时进行构建,即.NET Framework.使用project.json为.NET Framework构建的控制台应用程序与使用csproj为.NET Framework构建的控制台应用程序完全相同.

Calling the project.json build tools the ".NET Core SDK" was only partially true: the tools can be used to build for runtimes other than .NET Core, i.e. .NET Framework. A console app built for .NET Framework using project.json is exactly the same as a console app built for .NET Framework using csproj.

新的csproj格式尝试更正此常见的混淆.您会注意到,在VS 2017中,项目使用的是".NET SDK"(又名"Microsoft.NET.Sdk")(从名称中删除了Core).此新的SDK可用于构建.NET Framework,.NET Standard和.NET Core项目.

The new csproj format tries to correct this common mixup. You'll notice in VS 2017, projects use the ".NET SDK", aka "Microsoft.NET.Sdk" (dropped Core from the name). This new SDK can be used to build .NET Framework, .NET Standard, and .NET Core projects.

这篇关于在.NET Framework上运行.NET Core App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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