[c#] "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded"

I'm getting the error: "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."

I have a .NET 4.0 dll project that is being called by a .NET 2.0 project. Is there a way to reconcile the difference in framework?

This question is related to c# dll .net-4.0 .net-2.0

The answer is


I have a .NET 4.0 dll project that is being called by a .NET 2.0 project. Is there a way to reconcile the difference in framework?

Not that way round, no. The .NET 4 CLR can load .NET 2 assemblies (usually - there are a few exceptions for mixed-mode assemblies, IIRC), but not vice versa.

You'll either have to upgrade the .NET 2 project to .NET 4, or downgrade the .NET 4 project to .NET 3.5 (or earlier).


Similar questions with c# tag:

Similar questions with dll tag:

Similar questions with .net-4.0 tag:

Similar questions with .net-2.0 tag: