I have a dll library built in Visual Studio 2010, but I need to include it in a VS 2005 project.

If I do it, I get the error message

This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

I googled the error message, but the only workaround I found is to replace gacutil.exe located in C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin with the gacutil.exe located in C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools.

I tried this way, but I'm still getting the same error.

有帮助吗?

解决方案

You need to check which .NET framework the DLLs are aimed at.

You'll find that by default 2010 will be aimed at .NET 4.0 and 2005 will probably be .NET 3.0.

You can reference a .NET 3.0 library from .NET 4.0 code but not the otherway around.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top