简体   繁体   English

可以将.net 3.5二进制文件用于具有.net 4.0应用程序的库吗?

[英]can I use .net 3.5 binaries for a library with a .net 4.0 application / what are the negatives if any?

Can I use .net 3.5 binaries for a library with a .net 4.0 application / what are the negatives if any? 我可以将.net 3.5二进制文件用于具有.net 4.0应用程序的库吗?如果有的话,它有什么缺点? In other words is there any reason I should take more time out to download source for the library and build it under .net 4.0 (assuming it builds without any problems I guess) as opposed to downloading the .net 3.5 binaries. 换句话说,有什么理由比下载.net 3.5二进制文件有更多的时间来下载该库的源代码并在.net 4.0下进行构建(假设它的构建没有任何问题)。

I'm using C# in VS2010. 我在VS2010中使用C#。

thanks 谢谢

.NET 4.0 is compatible with .NET 3.5 and earlier, but as comments below indicate, best practice would be to recompile with .NET 4.0 when you can. .NET 4.0与.NET 3.5及更早版本兼容,但是如以下注释所示,最佳实践是在可能的情况下与.NET 4.0重新编译。

It is safe (and intended) that you can use assemblies targeting older versions of the framework. 可以使用针对框架的较早版本的程序集是安全的(并且可以预期的)。

No problems whatsoever. 没问题。 No expected ones anyway but I bet ya microsoft has one up their sleve, they tend to work in mysterious ways :) 无论如何,都没有预期的结果,但是我敢打赌,微软已经做好了准备,他们倾向于以一种神秘的方式工作:)

It should be fine but there are some issues that can arise but might now be fixed in the release version. 没问题,但是可能会出现一些问题,但现在可能会在发行版中解决。 See: 看到:

http://krishnabhargav.blogspot.com/2010/02/using-net-35-clr-20-dll-inside-visual.html

阅读本文中有关.NET 4.0兼容性的Microsoft建议: .NET Framework中的版本兼容性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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