简体   繁体   中英

Build against .Net Framework 3.5 in Visual Studio 2022

I have a project developed with.Net framework version 3.5 that used to be opened in Visual Studio 2012. I have VS 2022 installed on my machine, I opened the solution using it and it suggested upgrading the framework. A more experienced developer told me not to do that without any further explanations. I did not do anything else except closing VS.

Why opening older solutions in newer VS is a bad idea? it only added a hidden .vs folder in the solution's.

Can I build this solution using VS 2022 or I should find the older version and in any case where can I find the necessary SDK since it is no longer available on this page?

No bad idea. Also: don't be afraid, software like this isn't exactly know for nor written to just mess up your code. Since you mention the only thing which happened when opening the solution was the addition of a.vs directory, I assume that means that your solution, all project files and all source code is in version control - as it shoud be - and that is a line of defense which is hard to beat. So yes: if version control reports no changes, VS didn't make any changes, and there is no problem. And even if there were changes, VS would have told you about it and/or created a backup directory with the original. And you'd still be able to revert them in version control.

As to whether this builds in VS 2022: almost certainly yes, one way or another. You might need to have to install the .Net framework 3.5 development tools with the VS installer. Or otherwise: I'd personally give it a go and just upgrade and build to see what happens. .Net frameworks are all pretty much completely backwards compatible anyway. I'd even suggest to the other developers that it might be time to upgrade (or put another way: ask why it is needed to stick to ancient 3.5 - still targetting Windows XP or so?).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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