문제

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