c830
c830

Reputation: 514

Is there any way to load an assembly compiled in VS2010 in VS2005?

We have a function in a VS2005 project that loads assembles and get type information from them . It does not instantiate these types though. We tried to load some assembles that are compiled in 2010, but keep getting the following exception.

"Could not load file or assembly '2010ClassLibrary' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."

Is there anyway to get around this?

Upvotes: 0

Views: 425

Answers (2)

James Manning
James Manning

Reputation: 13579

you could run the app under .net 4 and then the code to load the assembly should be fine.

http://msdn.microsoft.com/en-us/library/f4kkd0k5.aspx

Upvotes: 1

Mikael Svenson
Mikael Svenson

Reputation: 39695

If you are not using any .Net 4 features in your code in the VS2010 solution, then set your target for the solution to be .Net 2.0 instead. This will allow you to reference it in VS2005. .Net 3.5 can be used in VS2008.

Upvotes: 5

Related Questions