Visual Studio Developer Center >
Visual Studio Forums
>
Visual Studio Extensibility
>
Is it possible to add items to ErrorList Window from an Add-in?
Is it possible to add items to ErrorList Window from an Add-in?
- EnvDTE80.ErrorItems interface does not expose something like add() method, and I've seen an article in this forum that it is impossible to parse strings to the ErrorList window using that ErrorItems interface.
Then is it impossible to add items to ErrorList Window from an Add-in?- Edited bynyam Monday, July 14, 2008 1:46 AMtypo
Answers
- Hi,
The following method can be used to output text to the build output window and the error list simultaneously (as either an error or a warning) in both VS 2005 and 2008:
OutputWindowPane.OutputTaskItemString Method
http://msdn.microsoft.com/en-us/library/envdte.outputwindowpane.outputtaskitemstring.aspx
Usage example:
VSEnvironmentBuildTrace.cs (uses OutputTaskItemString method)
http://www.codeplex.com/DocProject/SourceControl/FileView.aspx?itemId=454155&changeSetId=34004
VSEnvironmentHost.cs (defines BuildOutput property)
http://www.codeplex.com/DocProject/SourceControl/FileView.aspx?itemId=454156&changeSetId=34004
- Dave
http://davesexton.com/blog- Marked As Answer bynyam Sunday, July 27, 2008 8:56 AM
- Hi Carlos,
My implementation works fine in 2005 and 2008. It adds either errors or warnings to the Error List, not the Task List, despite the name of the method that I'm using. Just don't forget to call ForceItemsToTaskList.
- Dave
http://davesexton.com/blog- Marked As Answer byCarlos Quintero - MVPMVP, ModeratorTuesday, July 15, 2008 9:29 AM
All Replies
- Hi,
The following method can be used to output text to the build output window and the error list simultaneously (as either an error or a warning) in both VS 2005 and 2008:
OutputWindowPane.OutputTaskItemString Method
http://msdn.microsoft.com/en-us/library/envdte.outputwindowpane.outputtaskitemstring.aspx
Usage example:
VSEnvironmentBuildTrace.cs (uses OutputTaskItemString method)
http://www.codeplex.com/DocProject/SourceControl/FileView.aspx?itemId=454155&changeSetId=34004
VSEnvironmentHost.cs (defines BuildOutput property)
http://www.codeplex.com/DocProject/SourceControl/FileView.aspx?itemId=454156&changeSetId=34004
- Dave
http://davesexton.com/blog- Marked As Answer bynyam Sunday, July 27, 2008 8:56 AM
- While an add-in can add tasks to the Task List using the automation model (EnvDTE) it can't add errors to the Error List in VS 2005/2008. You need an to implement an ErrorProvider, and I have been unable to implement one inside an add-in, because you need some services that only SDK packages can provide.
MZ-Tools: Productivity add-ins for Visual Studio: http://www.mztools.com- Marked As Answer byCarlos Quintero - MVPMVP, ModeratorMonday, July 14, 2008 10:31 AM
- Unmarked As Answer byCarlos Quintero - MVPMVP, ModeratorTuesday, July 15, 2008 9:29 AM
- Hi Carlos,
My implementation works fine in 2005 and 2008. It adds either errors or warnings to the Error List, not the Task List, despite the name of the method that I'm using. Just don't forget to call ForceItemsToTaskList.
- Dave
http://davesexton.com/blog- Marked As Answer byCarlos Quintero - MVPMVP, ModeratorTuesday, July 15, 2008 9:29 AM
- Thanks! It works :)
- Some relevant link to video that might be helpful for those of forum members who're interested in interacting with ErrorList and TaskList:
How Do I: Iterate Through the Items in the Visual Studio Task List?
How Do I: Integrate with the Error List?
Hope that helps,
Dmitry [dimaka] Pavlov


