Pablo Galiano : How do I know if the solution is still building

Subscriptions

<September 2010>
SuMoTuWeThFrSa
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

News

Subscribe to Pablo Galiano by Email

Post Categories

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

posted on Monday, August 25, 2008 6:40 AM by pga

What do you think?

(required) 
required 
optional
required