title: Publish a web app from within an VS2010 Extension
body: <p>I want to publish a web app from within an VS2010 extension.
  In macro I use to write:</p>
  
  <pre><code>DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Activate()
  DTE.ActiveWindow.Object.GetItem("MyWebApp").Select(vsUISelectionType.vsUISelectionTypeSelect)
  DTE.ExecuteCommand("ClassViewContextMenus.ClassViewProject.Publish")
  </code></pre>
  
  <p>but this doesn't seem to work from within an extension (c#).</p>
  
  <p>It fails on the second line in c#, in VBA macro this works fine...</p>
  
  <p>What is the correct way to start publishing process from a VS2010 extension?</p>