How To: Obtain Initial Property Values in a Logger

We got a question on our MSBuild Feedback alias today that went something like this:

How do I obtain all the initial property values in the project file in my custom logger?

It's not immediately obvious from our object model, but you can do this. In the ProjectStarted event the ProjectStartedEventArgs contains a Properties member. You can iterate over this with a foreach to look at all the values of the properties in the project file.

Thanks to Dan for the question, and to Jay for the answer.

[ Author: Neil Enns ]