如何更新.net项目的目标框架? [英] How to update target framework of .net project?

查看:28
本文介绍了如何更新.net项目的目标框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 .Net Core 2.0 中创建了一个项目,现在随着 .Net Core 2.1 的新版本,我想更新它.那么我可以转到项目属性并将目标框架更新到 2.1 还是我还需要对我的代码进行任何更改?根据这篇文章 https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1,Microsoft.AspNetCore.All 包现在被 Microsoft.AspNetCore.App 取代.所以我想问一下如果我不更新这个包,我现有的代码会有什么变化吗?program.cs 和 startup.cs 文件代码等也有一些变化.所以简单地说,我的问题是什么是必要的更改,否则我现有的代码将停止工作.谢谢

I had created a project in .Net Core 2.0 and now with the new release of .Net Core 2.1, I want to update to it. So is it just ok that I go to project properties and update Target Framework to 2.1 or do I also need to make any change in my code? According to this article https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1, Microsoft.AspNetCore.All package is now replaced by Microsoft.AspNetCore.App. So I want to ask if I don't update this package, will anything happen to my existing code? Also there are some changes in program.cs and startup.cs files code etc. So in simple words my question is what are the necessary changes without which my existing code will stop working. Thanks

推荐答案

访问 https://www.microsoft.com/net/download/windows ,下载 SDK (2.1) 并将其安装到您的机器上.打开项目的 csproj 并将 netcoreapp2.0 更新为 netcoreapp2.1,最后您可以将Microsoft.AspNetCore.All"更新为 2.1 版.

Visit https://www.microsoft.com/net/download/windows , download SDK (2.1) and install it on your machine. Open your project's csproj and update netcoreapp2.0 to netcoreapp2.1 and finally you can update the "Microsoft.AspNetCore.All" to version 2.1.

这篇关于如何更新.net项目的目标框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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