How to update target framework of .net project?

廉价感情. 提交于 2021-01-29 11:08:20

问题


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


回答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.



来源:https://stackoverflow.com/questions/51151040/how-to-update-target-framework-of-net-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!