在同一台计算机上安装 .NET 4 会导致 .NET 3.5 或更低版本的应用程序产生任何风险吗?
我知道 .NET 支持并行执行,但是我见过这样的情况:一台机器有 2.0,另一台机器有 2.0 sp1,另一台机器有 .NET 3.5。在这些版本中,我使用的一些 Microsoft 生成的 DLL 添加了一些方法。我认为是 System.Net.Mail。
这是一件坏事,因为我使用的是 2.0 SP1 中可用的方法,而普通 2.0 中不存在该方法。我的应用程序出现异常,我的经理问我为什么不测试该用例。 有人知道在哪里可以找到适合这种情况的方法列表吗?
底线:这种经历让我不能 100% 相信 .NET 的并行声明。
谁能告诉我 .NET 4.0 的安装是否会以任何方式修改配置文件、二进制文件或以其他方式影响较低框架版本的任何内容的执行?
I understand that .NET supports side by side execution, however I've seen cases where one machine has 2.0, and another had 2.0 sp1, and another had .NET 3.5. In those versions there were methods added to some Microsoft-produced DLL's I was using. I think it was System.Net.Mail.
This was a bad thing since I was using a method available in 2.0 SP1, and not present within plain 2.0. My app got an exception, and my manager asked me why didn't I test for that use-case. Anyone know where to find a list of methods that fit in this scenario?
Bottom Line: That experience makes me not 100% trust the side-by-side claim of .NET.
Can anyone tell me if installation of .NET 4.0 will in any way modify a config file, binaries, or otherwise influence the execution of anything of a lower framework version?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
FxCop 规则可用于查找对非 RTM api 的调用。
There are FxCop rules for finding calls to non-rtm apis.
简而言之,安装 .Net 4.0 不会在任何方面影响早期版本,因为对于每个框架版本,配置都位于单独的文件夹中,并且二进制文件位于已经支持并行执行的 GAC 中。
您遇到的问题可能是由于您使用 SP1 版本时应用程序的配置指向早期版本,或者(如果是 Web 应用程序)您的服务器可能没有更新 SP1。
要获得每个版本中更改的完整列表,您必须进行大量搜索,但大多数时候,当您的开发计算机上安装了不同版本时,VS 会通知您已弃用的方法,对于新方法,只有在正确的情况下,它才会显示智能感知.Net 版本是有的。
In short, Installing .Net 4.0 shall not effect earlier versions in any regard, since for every framework version the config are in separate folders and binaries are in GAC that already supports side by side execution.
The problem you faced might be due to the config of your application pointing an earlier version while you are using SP1 version or (In case of web app) your server might not have the updated with SP1.
For comprehensive list of changes in each version you have to google a lot, but most of the time when you have different versions installed on your dev machine, the VS informs you of deprecated methods, for new ones it will show intellisense only if the right .Net version is there.