views:

51

answers:

0

I'm trying to hook into the ErrorListProvider in VS2010 to provide some more feedback from my VS2010 extension addin. The code is as follows:

        try
        {
            ErrorListProvider errorProvider = new ErrorListProvider(ServiceProvider);
            ErrorTask error = new ErrorTask();
            error.Category = TaskCategory.BuildCompile;
            error.Text = "ERROR!";
            errorProvider.Tasks.Add(error);
        }
        catch (InvalidOperationException)
        { }

However the following exception is thrown:

System.InvalidOperationException was caught Message=The service 'Microsoft.VisualStudio.Shell.Interop.IVsTaskList' must be installed for this feature to work. Ensure that this service is available. Source=Microsoft.VisualStudio.Shell.10.0 StackTrace: at Microsoft.VisualStudio.Shell.TaskProvider.get_VsTaskList() at Microsoft.VisualStudio.Shell.TaskProvider.Refresh() at Microsoft.VisualStudio.Shell.TaskProvider.TaskCollection.Add(Task task)

Does anyone have any ideas why?