I am currently writing some Visual Studio automation and would like to use the experimental hive so that when one of our users fires off Visual Studio from within our code any changes we make through code to windows toolbars etc are not persisted in their main version of Visual Studio. I have experimented with windows configurations, restoring settings on close etc, but this is still to risky for my liking (if the program crashes Visual Studio will be pretty messed up next time it is loaded outside of our code!!). This works perfectly from the command line using the rootsuffx argument but my problem lies in the fact that I need to start devenv.exe from code and get hold of the DTE2 com object. At present we do this by getting the CLSID or the ProgID and using system.activator like so...
System.Type type = System.Type.GetTypeFromProgID("VisualStudio.DTE.8.0");
Object obj = System.Activator.CreateInstance(type, true);
this.m_visualStudio = (EnvDTE80.DTE2)obj;
How can I do this with command line arguments? Is there a way of getting a com object from a running process? i.e. I could create the process, get the processId then generate the com object for that process somehow? or is that not how com objects work?
I've already tried adding the switch to the LocalServer32 entry for VisualStudio.DTE.8.0 to see if that worked but then system.activator returns a directory not found exception? (which I am sure is not down to the syntax I'm using in the registry entry...
"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe /RootSuffix Exp"
Any help would be much appreciated - if this works we can then generate our own seperate hive and use that for our VS interop which would be the ideal...
Regards
Paul
System.Type type = System.Type.GetTypeFromProgID("VisualStudio.DTE.8.0");
Object obj = System.Activator.CreateInstance(type, true);
this.m_visualStudio = (EnvDTE80.DTE2)obj;
How can I do this with command line arguments? Is there a way of getting a com object from a running process? i.e. I could create the process, get the processId then generate the com object for that process somehow? or is that not how com objects work?
I've already tried adding the switch to the LocalServer32 entry for VisualStudio.DTE.8.0 to see if that worked but then system.activator returns a directory not found exception? (which I am sure is not down to the syntax I'm using in the registry entry...
"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe /RootSuffix Exp"
Any help would be much appreciated - if this works we can then generate our own seperate hive and use that for our VS interop which would be the ideal...
Regards
Paul