简体   繁体   English

在 .NET 框架上运行 .NET 核心应用程序

[英]Running .NET core App on .NET framework

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.我正在阅读这篇文章: 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/关于为 .NET 核心应用程序使用不同的名字,我想知道使用 .NET 框架 4.5.1 创建 ConsoleApp 和创建具有名字设置为 .net 框架 4.5 的 ConsoleApp .NET 核心之间有什么区别。 1.

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).我能想到的唯一区别是第一个将使用 csproj,第二个将使用 xproj(好吧,xproj 现在已弃用,因此使用新的 csproj 格式)。 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.我问这个问题是因为我当前的应用程序构建在 .NET 框架 4.5.1 之上,我正在考虑将它迁移到 .NET 框架之上的 .NET 核心。

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, ie .NET Framework.将 project.json 构建工具称为“.NET Core SDK”只是部分正确:这些工具可用于构建 .NET Core 以外的运行时,即 .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.使用 project.json 为 .NET Framework 构建的控制台应用程序与使用 csproj 为 .NET Framework 构建的控制台应用程序完全相同。

The new csproj format tries to correct this common mixup.新的 csproj 格式试图纠正这种常见的混淆。 You'll notice in VS 2017, projects use the ".NET SDK", aka "Microsoft.NET.Sdk" (dropped Core from the name).您会注意到,在 VS 2017 中,项目使用“.NET SDK”,又名“Microsoft.NET.Sdk”(从名称中删除了 Core)。 This new SDK can be used to build .NET Framework, .NET Standard, and .NET Core projects.这个新的 SDK 可用于构建 .NET Framework、.NET Standard 和 .NET Core 项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM