ayang
ayang

Reputation: 446

VS2008 can't reference a .NET 3.5 assembly built in VS2010?

I know that VS2008 can't work with .NET 4.0 and that the .NET 4.0 assembly file format has changed from 3.5. However, I would have thought that assemblies built by VS2010 targeting .NET 3.5 or earlier would be compatible with VS2008.

Attempting to reference a VS2010 DLL results in the yellow caution overlay on the icon, and a "This project cannot be viewed in the object browser because it is unavailable or not yet built. Please ensure that the project is available and built." dialog pops up when you attempt to open the reference.

The VS2010 assembly is being built as Release/Any CPU - and this is on Windows 7 32-bit. The assembly is not being signed.

What am I missing?

Upvotes: 1

Views: 2686

Answers (2)

ayang
ayang

Reputation: 446

Turns out that there were post-build actions occurring which include calling ildasm and ilasm in order to rename methods within the assembly. During this process, obviously something is getting corrupted in the DLL.

When I do not perform the post-build activities, the assembly (that targets .NET 3.5) can be referenced in VS2008 just fine.

Upvotes: 0

Hans Passant
Hans Passant

Reputation: 941347

It seems to think the assembly is created by another project in the solution. Maybe that was once the case and you removed the project from the solution? Delete the assembly reference and add it back with the Browse tab.

Upvotes: 1

Related Questions