Access Visual Studio 2010 project properties in a Visual Basic macro

My company works a lot with LINT , so to make our life easier, we wrote several Macros in Visual Studio that allowed us to easily compile LINT files. However, we ran into a problem. Because the format of the Visual Studio 2010 files changed, our macros no longer worked, so my company instructed me to update them. My problem is here. I am trying to access the preprocessor definitions of the currently selected VS project inside the macro , but the names used on the Project Properties page do not appear in the code. I searched on the Internet, trying to find a way to access this information in my code, but all the answers I found point me in the wrong direction.
The classes that I thought were supposed to work are DTE.Project and DTE.Configuration classes. Any ideas on how I can get the information I'm looking for inside the code?

EDIT: I know (thanks http://msdn.microsoft.com/en-us/library/aa984571(v=vs.71).aspx ) that there is no direct programmatic access to properties via the ProjectProperties interface , but this does not make it impossible .

EDIT: the properties of an object of the Project and Configuration class do not match the properties specified in the project properties interface. The properties I'm looking for may exist under one of these properties or may exist in another class

+4
source share
1 answer

After talking with the authorities, we decided to go towards the VS-add-in, since Damien_The_Unbeliever was right. However, I quickly ran into the same issue in C # as in VB. This was decided by a dumb amount of metaprograms. http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/23763118-c34f-45fc-97aa-5fe5c4ad4d5c/ This was the only useful link I found in two days of searching for everyone who facing this problem.

I hope this explains :)

+1
source

Source: https://habr.com/ru/post/1434765/


All Articles