Using dlls compiled in Visual Studio 2010 with target .NET Framework 4.0 in Visual Studio 2008
I know it's a bit close to Can I use .NET 4.0 beta in Visual Studio 开发者_JAVA技巧2008?
But my question is a bit different. I have a project that now uses .NET 4.0 (target .NET Framework 4.0) in Visual Studio 2010. Is it possible to use the project compiled dlls in Visual Studio 2008? How?
I don't want to use .NET4.0 directly in Visual Studio 2008, only the compiled dlls with target .NET Framework 4.0 (this is how my question is different that what has been asked so far).
I know that I was able to use .NET3.5 in Visual Studio 2005. So why not .NET4.0 in Visual Studio 2008?
.NET 3.5 didn't have new versions of mscorlib, System.dll etc - it had new assemblies, but the ones you could use from .NET 2 were the same.
.NET 4 introduces new versions of these core assemblies - and your built DLL will reference those new versions explicitly. Visual Studio 2008 doesn't know about those versions - or the CLR which goes with them.
If you want to use a library in Visual Studio 2008, you should target .NET 3.5 to start with.
精彩评论