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 incompatible. Is there a way to prevent this?
I assume the other option is configure 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.