Blog Stats
  • Posts - 52
  • Articles - 0
  • Comments - 6
  • Trackbacks - 12

 

Creating a VS2005 instance

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

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Feedback

No comments posted yet.


Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

 

 

Copyright © Pablo Galiano