Asked By Sharon
12-Nov-09 08:26 AM
string solutionFileName = @"D:\Dev\App\MuSolution.sln";
System.Type vsType = System.Type.GetTypeFromProgID("VisualStudio.DTE.9.0",
true);
// this one works woks fine.
object obj = System.Activator.CreateInstance(vsType, true);
// But this one throws en exception
obj = System.Activator.CreateInstance(vsType, new object[] {
solutionFileName });
The thrown exception is:
System.MissingMethodException "Constructor on type 'System.__ComObject' not
found."
But if I was the command line via CMD window as follow:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>devenv.exe
The VS is open nicely together with the solution.
How to I create an instance of the VS2008 that will open my solution of
choice via EnvDTE80 automation?
--
Thanks
Sharon