Geeks With Blogs
Coding Beyond... Pablo Alberto Galiano

Sometimes is very usefull for testing purposes to create a VS2005 instance, and them use that instance to have access to the DTE API stuff.

So, here is a code snippet to create a VS2005 instance and to open a solution:

            Type t = Type.GetTypeFromProgID("VisualStudio.DTE.8.0");

            DTE dte = (DTE)System.Activator.CreateInstance(t, true);

            try
            {
                dte.Solution.Open(@"C:\Temp\Temp.sln");

                //Wait some seconds to let VS open the solution
                System.Threading.Thread.Sleep(5000);
            }
            finally
            {
                dte.Solution.Close(false);
            }

Pablo

Posted on Thursday, April 20, 2006 12:06 PM GAT , Whidbey General | Back to top


Comments on this post: Creating a VS2005 instance

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Pablo Galiano | Powered by: GeeksWithBlogs.net