Visaul Studio 2010, TlbImp generates .net 4.0 interops in 2.0 projects

Posted by DJScrib on Stack Overflow See other posts from Stack Overflow or by DJScrib
Published on 2010-04-17T19:41:13Z Indexed on 2010/04/17 19:43 UTC
Read the original article Hit count: 203

Filed under:
|
|

In a C# project we add a reference to a COM object via the Add References setup pointing to a COM object which results in the IDE auto-generating the interop assembly. So this is fine and good, but we are building based on .net 3.5 SP1 aka CLR 2.0, and the generated interops are using the 4.0 CLR making them incompatiable. Is there a way to prevent this?

I assume the other option is in our build script to try using tlbimp.exe with the /references parameter? to point to mscorlib v2.0?

Anyhow, I'm hoping there's a flag somewhere to allow this.

© Stack Overflow or respective owner

Related posts about VS2010

Related posts about interop