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

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

问题描述

我已经在.Net Core 2.0中创建了一个项目,现在使用新版本的.Net Core 2.1,我想对其进行更新.所以我可以转到项目属性并将Target Framework更新为2.1,还是还需要对代码进行任何更改吗?根据本文 https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1 ,Microsoft.AspNetCore.所有软件包现在都已由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天全站免登陆