Pablo Galiano : Friday, August 22, 2008 - Posts

Subscriptions

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

News

Subscribe to Pablo Galiano by Email

Post Categories

Friday, August 22, 2008 - Posts

Visual Studio guids

As we already know, almost every Visual Studio component has unique identifier (GUID). This post will try to summarize the list of most commonly used guids and the classes where they are defined, so we don't end up hardcoding guids in our code.

 

Menus

Microsoft.VisualStudio.Shell.VsMenus, Microsoft.VisualStudio.Shell.9.0, Version=2.0.0.0

 

Commands


Microsoft.VisualStudio.VSConstants.VSStd2KCmdID, Microsoft.VisualStudio.Shell.9.0, Version=2.0.0.0

Microsoft.VisualStudio.VSConstants.VSStd97CmdID, Microsoft.VisualStudio.Shell.9.0, Version=2.0.0.0

 

Project kinds

VSLangProj.PrjKind, VSLangProj, Version=7.0.3300.0

VSLangProj2.PrjKind2, VSLangProj2, Version=7.0.5000.0

 

Project item kinds

EnvDTE.Constants.vsProjectItemKindMisc, EnvDTE, Version=8.0.0.0

EnvDTE.Constants.vsProjectItemKindPhysicalFile, EnvDTE, Version=8.0.0.0

EnvDTE.Constants.vsProjectItemKindPhysicalFolder, EnvDTE, Version=8.0.0.0

EnvDTE.Constants.vsProjectItemKindSolutionItems, EnvDTE, Version=8.0.0.0

EnvDTE.Constants.vsProjectItemKindSubProject, EnvDTE, Version=8.0.0.0

EnvDTE.Constants.vsProjectItemKindVirtualFolder, EnvDTE, Version=8.0.0.0

 

Logical views

Microsoft.VisualStudio.Shell.Interop.LogicalViewID, Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0

 

Output window panes

Microsoft.VisualStudio.VSConstants.GUID_BuildOutputWindowPane, Microsoft.VisualStudio.Shell.9.0, Version=2.0.0.0

Microsoft.VisualStudio.VSConstants.GUID_OutWindowDebugPane, Microsoft.VisualStudio.Shell.9.0, Version=2.0.0.0

Microsoft.VisualStudio.VSConstants.GUID_OutWindowGeneralPane, Microsoft.VisualStudio.Shell.9.0, Version=2.0.0.0

 

Toolwindows

Microsoft.VisualStudio.Shell.Interop.ToolWindowGuids, Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0

Microsoft.VisualStudio.Shell.Interop.ToolWindowGuids80, Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0

 

Contexts

Microsoft.VisualStudio.Shell.Interop.UIContextGuids, Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0

Microsoft.VisualStudio.Shell.Interop.UIContextGuids80, Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0

VSLangProj80.vsContextGuids, VSLangProj80, Version=8.0.0.0

 

PS:

I will continue updating this post when I remember new ones. I will use this post to list every useful guid that I know. Also if you have other ones please send me a comment.

 

Hope this helps,

Pablo

posted Friday, August 22, 2008 9:23 AM by pga with 1 Comments

How do I save a project via API in silent mode

My eighth How do I is up.

Scenario

When we modify a project file programmatically and we save it, Visual Studio monitors file changes and when a change is detected the following dialog appears:

 silent.png

Let's say that we control the change of the project file and want to avoid that dialog. The focus of this How do I tackles this scenario.

Interfaces and classes needed

 

Code snippet

    public static void SaveProjectSilent(IServiceProvider serviceProvider, IVsHierarchy project)

    {

        IVsSolution solution = serviceProvider.GetService(typeof(SVsSolution)) as IVsSolution;

 

        ErrorHandler.ThrowOnFailure(

            solution.SaveSolutionElement(

                (uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_ForceSave,

                project,

                (uint)VSConstants.VSCOOKIE_NIL));

    }

Assemblies needed

  • Microsoft.VisualStudio.Shell.Interop 
  • Microsoft.VisualStudio.Shell.9.0

 

Stay tuned,

Pablo

posted Friday, August 22, 2008 5:51 AM by pga with 5556 Comments