int IVsUpdateSolutionEvents.OnActiveProjectCfgChange(IVsHierarchy pIVsHierarchy) { // This method is called if the user is changing solution or project configuration e.g. from Debug to Release. // Also if a new solution config was created. // This method is called for each Hierarchy element (e.g. project and folders), thus we filter for the startup project // to only trigger the config changed event once. if (GetUniqueName(pIVsHierarchy) == StartupProjectUniqueName()) { StartupProjectConfigurationChanged?.Invoke(this, EventArgs.Empty); } return(S_OK); }
int IVsUpdateSolutionEvents.OnActiveProjectCfgChange(IVsHierarchy pIVsHierarchy) { // This method is called if the user is changing solution or project configuration e.g. from Debug to Release. // Also if a new solution config was created. // This method is called for each Hierarchy element (e.g. project and folders), thus we filter for the startup project // to only trigger the config changed event once. object objProj = null; pIVsHierarchy?.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ExtObject, out objProj); EnvDTE.Project project = objProj as EnvDTE.Project; if (project?.UniqueName == StartupProjectUniqueName()) { StartupProjectConfigurationChanged?.Invoke(this, EventArgs.Empty); } return(S_OK); }