I'm making Visual Studio package, and I need to know opened solution name and configuration. How can I get this information ?
How to get current solution configuration in vspackage?
Asked Answered
If you have a reference to EnvDTE, you can use dte.Solution
and dte.Solution.SolutionBuild.ActiveConfiguration
.
thanks for answer, but i get crash with exception(Retrieving the COM class factory for component with CLSID), after googling i found that it should solution be in x86. Is it so ? –
Beneficent
A VS Package must be compiled as x86. Visual Studio is 32-bit only. –
Donatello
And for those looking on how to get a reference to the
DTE
, call the GetService()
method as such: DTE dte = (DTE)GetService(typeof(DTE));
. –
Anissaanita © 2022 - 2024 — McMap. All rights reserved.