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