title: How to initialize EnvDTE80.DTE2 object to access the solution?
body: <p>I am using reference of EnvDTE80 in my code to open a visual studio solution and then traverse through the projects present in it.
  I am new to this and am using the below code snippet :
  Firstly defined an object of the below type :</p>
  
  <pre><code>EnvDTE80.DTE2 dte2;
  </code></pre>
  
  <p>then tried to access the solution through it :</p>
  
  <pre><code>Solution2 solution = dte2.Solution as E2.Solution2;
  if (solution == null)
  {
  return;
  }
  
  Projects projects = solution.Projects;
  foreach (E1.Project project in projects)
  {
  Property outputPath =
  project.ConfigurationManager.ActiveConfiguration.Properties
  .Item("outputPath");
  outputPath.Value = buildFolderPath;
  project.Save(project.FullName);
  }
  </code></pre>
  
  <p>Basically I am trying to change the project output path through the code snippet and whenever I run the code I get an error stating that "Object Reference not set to an instance of an object".
  The "dte2" object is null. </p>
  
  <p>Any suggestions how to initialize it ?</p>