Skip to content

Instantly share code, notes, and snippets.

@jpobst
Created March 8, 2012 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpobst/2003908 to your computer and use it in GitHub Desktop.
Save jpobst/2003908 to your computer and use it in GitHub Desktop.
private void AddError (Project prj, string text, TaskErrorCategory category)
{
IVsSolution solution = (IVsSolution)package.GetVSService (typeof (IVsSolution));
IVsHierarchy hierarchy = null;
if (prj != null)
solution.GetProjectOfUniqueName (prj.UniqueName, out hierarchy);
ErrorTask task = new ErrorTask ();
task.Text = text;
task.ErrorCategory = category;
task.HierarchyItem = hierarchy;
package.ErrorListProvider.AddTask (text, (int)category, hierarchy);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment