Gabriel said:
There are several ways to interact with the VS object model that Greg
mentions.
You can:
- create an addin (essentially an assebly that loads within the VS
process).
This has been rejected by my team leader, we have to wite separate app
that adds the toolbox item.
- create a macro (check Tools->Macros->Macros IDE)
I'll investigate this
- create a separate exe that opens VS and manipulates it through the
object model or manipulates a currently open instance of VS (you can
get a reference to a running instance of VS by using
Marshal.GetActiveObject, if there's more than one version of VS
that's open you would need to do some extra work to determine which
VS you want to manipulate (you would have to enumerate the elements
of the Running Object Table, as far as I know you would have to
invoke the native methods because the framework does not support
this)).
What about this approach?
http://techrepublic.com.com/5100-6329-5034244.html
I tried to follow the steps from hte article, but, this line a code
raises an exception I have described in another post: EnvDTE.DTE env =
new EnvDTE.DTE();
Untill now, if we figure how to avoid that 1.1 framework bug, most
probably this will be the solution we will choose. The drawback is that
adding components to toolbox is far too slow. We have to add arround 30
components from the same dll. Is there a method of adding all
components from a dll at once? I understood that, for adding component
by component, the IDE loads and frees the dll every time, which is time
consuming.
Thanks for answering,
Christina Androne