如何将Windows应用程序从.NET2.0转换为.NET3.5
将 Windows 应用程序从 .NET2.0 转换为 .NET3.5 时,我遇到问题。 我这样做: 1.在Win XP中,我启动VS2008并打开我的解决方案项目,该项目由4个项目组成; 2. 在所有这 4 个项目属性窗口的“应用程序”选项卡中,我选择目标框架值“.NET Framework 3.5” 3. 我重建了解决方案,但所有对 .NET 2.0 的旧引用仍然存在...有人写道,从 2.0 转换为 3.5 后的所有引用都必须自动引用到我计算机上的 3.5 dll。
我做错了什么?请帮忙提供一些建议。谢谢
I have problem, when converting Windows application from .NET2.0 to .NET3.5.
I do this like so:
1. In Win XP I start VS2008 and open my solution project which consists of 4 projects;
2. On all of these 4 project Properties window in tab "Application" I select target framework value ".NET Framework 3.5"
3. I rebuild the solution, but all the old references to .NET 2.0 remains... It was written, that all the references after converting from 2.0 to 3.5 must be referenced automaticaly to 3.5 dll's, that are on my computer.
What I do wrong? Please help with some advice. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你可能已经没事了。虽然3.5听起来像是2.0的升级版,但实际上更多的是2.0的扩展。所有 dll(例如 System、System.Data 等)仍将是 2.0 版本。没有任何 3.5 版本的 System.Data。 3.5 项目的区别在于,有一些新的 dll,例如 System.Core、System.Xml.Linq 等,它们都将是 3.5 版本
创建一个新的 3.5 项目,并将该项目的引用与升级后的项目进行比较,然后您就可以会明白我的意思。
You're probably already OK. Even though it sounds like 3.5 is an upgrade of 2.0, it's actually more of an extension of 2.0. All the dlls like System, System.Data, etc. will still be version 2.0. There isn't any 3.5 version of System.Data. The difference in a 3.5 project is that there are NEW dlls like System.Core, System.Xml.Linq, etc. that will all be version 3.5
Create a new 3.5 project, and compare the references from that project to your upgraded project and you'll see what I mean.
您如何知道您引用的是 .net 2.0 而不是 .net 3.5?因为.net 3.5只是.net 2.0的扩展,基本上所有.net 3.5也是.net 2.0程序集。 因此,如果您的代码在面向 .net 3.5 时可以编译,那么您已经在 3.5
如果您面向 .net 3.5,那么这意味着将启用一些额外的程序集进行编译(例如 LINQ 相关的程序集),如果您以 .net 2.0 为目标,这意味着这些程序集未启用。
您所有的 .net 2.0 都可以轻松转换为 3.5。
How do you know whether you are referencing to .net 2.0 instead .net 3.5? Because .net 3.5 is just an extension of .net 2.0, and basically all .net 3.5 are also .net 2.0 assemblies. So if your code can compile when you are targeting .net 3.5, you are already on 3.5
If you target .net 3.5, then that means that some extra assemblies will be enabled for compilation ( such as LINQ related assemblies), if you target .net 2.0, this means that those assemblies are not enabled.
All your .net 2.0 can be converted to 3.5 without hassle.
只要您从未更改项目的引用来引用系统程序集的“特定版本”,它们都会自动切换到 3.5 版本。
不过,您需要添加对 3.5 中任何新内容的引用。我的猜测是,您可能缺少对 System.Core 的引用,它将添加 LINQ 支持。
As long as you never changed your project's references to reference a "specific version" of the system assemblies, they'll all automatically switch to the 3.5 versions.
You will, though, need to add a reference to anything new in 3.5. My guess is that you're probably missing the reference to
System.Core
, which will add LINQ support.