Reputation: 2299
I am trying to create a VS extension that will automate some of the repetitive work done by hand when building a new version of a project (like moving .MSI files around and stuff like that). I wish for the extension to different things based on the solution configuration debug/release status.
In simple terms - If the user is working on a solution in debug configuration and than presses my extension button it will do something different than if he is working on a release configuration. The question is, how can I while in the extension context identify the working configuration of the solution?
any leads will be appreciated.
Upvotes: 1
Views: 276
Reputation: 9249
I think you are looking for SolutionConfiguration2
:
DTE dte = (DTE)ServiceProvider.GetService(typeof(DTE));
SolutionBuild builder = dte.Application.Solution.SolutionBuild;
SolutionConfiguration2 config = (SolutionConfiguration2)builder.ActiveConfiguration;
The MSDN page also contains an example how to read the needed properties
Upvotes: 2