How to get current solution configuration in vspackage?
Asked Answered
B

1

2

I'm making Visual Studio package, and I need to know opened solution name and configuration. How can I get this information ?

Beneficent answered 25/10, 2012 at 14:45 Comment(0)
D
2

If you have a reference to EnvDTE, you can use dte.Solution and dte.Solution.SolutionBuild.ActiveConfiguration.

Donatello answered 25/10, 2012 at 15:39 Comment(3)
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.