Skip to content
May 8, 2012 / ravyoli

Getting build errors from Visual Studio 2010 extension

Hi readers,

So, this is the technique I used to get the build errors.

Getting just the errors description is simple. You can use this:

dte.ExecuteCommand("View.ErrorList", " ");  myErrors = dte.ToolWindows.ErrorList;

Unfortunately, this doesn’t give error codes, but just the error text description. If I’m looking for a specific error, then I can’t rely on the error text as this may change according to language culture. Also, if the user chose to not view warning in the error list window, so you also won’t be able to get the warnings.

Elisha suggested that I use the output from the build. So this just what I did.

I am parsing the build output, splitting by line and searching for the specific error codes im interested in.

This seems to work very well. Thanks Elisha!

Leave a comment