http://blogs.clariusconsulting.net/pga

Pablo Galiano's Blog

Go Back to
pga′s Latest post

How do I know if the solution is still building

My tenth How do I is up.

Scenario

The scenario is really simple, we want to know if the solution is still building. The focus of this How do I shows how to do it.

 

Interfaces and classes needed

 

Code snippet

    public static bool IsSolutionBuilding(IServiceProvider serviceProvider)

    {

        IVsSolutionBuildManager buildManagerService =

            serviceProvider.GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager;

 

        int isBuildManagerBusy = 0;

        ErrorHandler.ThrowOnFailure(buildManagerService.QueryBuildManagerBusy(out isBuildManagerBusy));

 

        return (isBuildManagerBusy == 1);

    } 

 

Assemblies needed

  • Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

 

Stay tuned,

Pablo

Comments