views:

66

answers:

2

I am writing a plugin for Visual Studio, I am able to see all the properties of all the references for a project, except for one property.

How can I access the "Embed Interop Types" property of a reference programmatically?

Right now I am using the VSLangProj80.Reference3 class to get the properties, but it does not include the "Embed Interop Types" property.

I have found a reference to a Microsoft internal use enumeration, VsProjReferencePropId100.DISPID_Reference_EmbedInteropTypes, but don't know how to use it to find the information I am looking for.

A: 

Yes, cannot work. VSLangProj80 dates from VS2005, the property was added in VS2010. There is a VSLangProj100 but it contains nothing but three enumeration types. The VsProjReferencePropId100 enum indeed defines DISPID_Reference_EmbedInteropTypes. It is the kind of identifier you'd use in late-bound COM.

I'm not up to speed on this, but I'm guessing that you might get something out of ProjectItem.Properties.

Hans Passant
A: 

I'm having the same problem. Did you figure out how to get to this property?

Sabine
I haven't been able to get this to work, I ran into a few other issues and haven't worked on that part since.
JoshVarga
In the end we made use of the project's XML file to get and change this information. You can have a look at the code here http://assemblyreftool.codeplex.com/ if you ever start working on this part again.
Sabine