简体   繁体   English

我的 .NET Core 3.1 应用程序可以移植到 .NET 5 吗?

[英]Is my .NET Core 3.1 app portable to .NET 5?

I'm currently trying to port an ASP .NET Core 3.1 application to .NET 5.0.我目前正在尝试将 ASP .NET Core 3.1 应用程序移植到 .NET 5.0。

In my app I use some 3rd party NuGet packages, which rely on .NET Core 3.1 and will not be ported to .NET 5.在我的应用程序中,我使用了一些第 3 方 NuGet 包,它们依赖于 .NET Core 3.1,不会移植到 .NET 5。

Though I try to figure out if my application is fully portable to .NET 5.虽然我试图弄清楚我的应用程序是否完全可移植到 .NET 5。

In my app, I did the following steps:在我的应用程序中,我执行了以下步骤:

  • I updated the target framework in the .csproj file我更新了.csproj文件中的目标框架
<TargetFramework>net5.0</TargetFramework>
  • Then I updated all NuGet packages - it seems to work fine without errors.然后我更新了所有 NuGet 包 - 它似乎工作正常而没有错误。

Unfortunately I'm not sure, because in Solution Explorer => Project => Dependencies => Frameworks, I see the usage Microsoft.AspNetCore.App and Microsoft.NETCore.App.不幸的是我不确定,因为在解决方案资源管理器 => 项目 => 依赖项 => 框架中,我看到了 Microsoft.AspNetCore.App 和 Microsoft.NETCore.App 的用法。

在此处输入图像描述

My first question is, is it a problem to use Microsoft.AspNetCore.App and Microsoft.NETCore.App in the same .NET 5 app?我的第一个问题是,在同一个 .NET 5 应用程序中使用 Microsoft.AspNetCore.App 和 Microsoft.NETCore.App 是否有问题? What is the difference between those Frameworks?这些框架之间有什么区别?

  • In a next step I run the .NET Portability Analyzer with target framework .NET 5.0 - the report says it is about 97% portable - but the dependent NuGets in .NET Core 3.1 cannot be altered.在下一步中,我使用目标框架 .NET 5.0 运行 .NET 可移植性分析器 - 报告称它的可移植性约为 97% - 但 .NET Core 3.1 中的依赖 NuGet 无法更改。

My second question is, can I use .NET Core 3.1 NuGet packages in a .NET 5 application?我的第二个问题是,我可以在 .NET 5 应用程序中使用 .NET Core 3.1 NuGet 包吗? I cannot change these 3rd party NuGet packages.我无法更改这些第 3 方 NuGet 软件包。 It seems to work, but I thought it's not possible.它似乎有效,但我认为这是不可能的。

How can I verify if I can fully port my app from .NET Core 3.1 to .NET 5?如何验证我是否可以将我的应用程序从 .NET Core 3.1 完全移植到 .NET 5?

You can.你可以。 Just upgrade all your project dependencies via NuGet to latest stable version and it will let you upgrade your.Net Core 3.1 to.Net 5. I have recently done on two projects working on.只需通过 NuGet 将所有项目依赖项升级到最新的稳定版本,它就可以让您将.Net Core 3.1 升级到.Net 5。我最近完成了两个项目。 One of them is on Dev server working fine without any issue.其中之一在开发服务器上运行良好,没有任何问题。

On hosting server you need to install .net 5 Hosting Bundle and restart the server... that's it在托管服务器上,您需要安装 .net 5 Hosting Bundle 并重新启动服务器......就是这样

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

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