Here you can get the active IVsBuildableProjectCfg for the given IVsHierarchy , which I call ppHierarchy below:
IVsSolutionBuildManager buildManager = (IVsSolutionBuildManager)GetService(typeof(SVsSolutionBuildManager)); IVsProjectCfg[] ppIVsProjectCfg = new IVsProjectCfg[1]; buildManager.FindActiveProjectCfg(IntPtr.Zero, IntPtr.Zero, ppHierarchy, ppIVsProjectCfg); IVsBuildableProjectCfg ppIVsBuildableProjectCfg; ppIVsProjectCfg[0].get_BuildableProjectCfg(out ppIVsBuildableProjectCfg);
Then you can subscribe to create events using:
uint pdwCookie; ppIVsBuildableProjectCfg.AdviseBuildStatusCallback(new MyBuildStatusCallback(), out pdwCookie);
Where MyBuildStatusCallback is the object you create that implements IVsBuildStatusCallback .
Hope this helps!
source share