ErrorListProvider in VS2010 throws InvalidOperationException about IVsTaskList

Posted by Ben Hall on Stack Overflow See other posts from Stack Overflow or by Ben Hall
Published on 2010-05-10T19:21:34Z Indexed on 2010/05/10 19:24 UTC
Read the original article Hit count: 1009

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?

© Stack Overflow or respective owner

Related posts about visual-studio-2010

Related posts about visual-studio-2010-extens