I am opening VS2010 solutions using C# and VS2010 automation. I open the solutions like this:
Type type = Type.GetTypeFromProgID("VisualStudio.DTE.10.0", true);
Object comObject = Activator.CreateInstance(type);
...
sol.Open(solution_full_path);
The problem I am having is that when I create the instance of the VisualStudio.DTE.10.0 object, it starts the devenv.exe process from winlogon.exe which sees completely different environment than my application. Some of the environment variables are important for resolving some paths set in projects.
Is there any how I can influence the environment variables of the devenv.exe process? Is there any way how I could inject environment/properties using the VS2010 automation interfaces?
Is it possible to start devenv by yourself inside your environment. Then get your hands on the running Visual Studio Instance via the running object table (ROT).
You will get problems if you have more than one running VS instance but this also an easy one. You can get your hands on a specific VS instance where you only need to know the process id of your self started VS instance.