在 Visual Studio 2022 中针对 .Net Framework 3.5 进行构建
我有一个使用 .Net Framework 版本 3.5 开发的项目,该项目过去在 Visual Studio 2012 中打开。我的计算机上安装了 VS 2022,我使用它打开了解决方案,它建议升级框架。一位更有经验的开发人员告诉我在没有任何进一步解释的情况下不要这样做。除了关闭VS我没有做任何其他事情。
为什么在新的 VS 中打开旧的解决方案是一个坏主意?它仅在解决方案中添加了一个隐藏的 .vs
文件夹。
我可以使用 VS 2022 构建此解决方案吗?或者我应该找到旧版本,并且在任何情况下我都可以在哪里找到必要的 SDK,因为它不再在 此页面?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不错。另外:不要害怕,像这样的软件并不是完全了解的,也不是为了弄乱你的代码而编写的。由于您提到打开解决方案时发生的唯一事情是添加了 .vs 目录,我认为这意味着您的解决方案、所有项目文件和所有源代码都处于版本控制中 - 正如它应该的那样 - 这是一个难以攻破的防线。所以是的:如果版本控制报告没有更改,则 VS 没有进行任何更改,并且没有问题。即使有变化,VS 也会告诉你它和/或用原始目录创建一个备份目录。而且您仍然可以在版本控制中恢复它们。
至于这是否会在 VS 2022 中构建:几乎可以肯定是的,无论怎样。您可能需要使用 VS 安装程序安装
.Net Framework 3.5 开发工具
。否则:我个人会尝试一下,然后升级并构建,看看会发生什么。无论如何,.Net 框架几乎都是完全向后兼容的。我什至建议其他开发人员可能是时候升级了(或者换句话说:问为什么需要坚持古老的 3.5 - 仍然针对 Windows XP 左右?)。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?).您可以尝试使用 vs 2017 或 2019
You can try using vs 2017 or 2019