Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / December 2007

Tip: Looking for answers? Try searching our database.

Error List

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fabrice Marguerie - 22 Nov 2005 03:20 GMT
Does someone know how to add items to the Error List in VS 2005?
Would someone have a code sample on how to add items to the Task List of
VS2005 as well?

Fabrice
Carlos J. Quintero [VB MVP] - 22 Nov 2005 09:34 GMT
Once you get the EnvDTE.Window object (I assume that you know this part),
Window.Object returns an object that, depending on the window, you can cast
to EnvDTE.TaskList or EnvDTE80.ErrorList, which have the collections
EnvDTE.TaskItems (or EnvDTE80.TaskItems2) and ErrorItems, and at least the
TaskItems collection has Add() methods.

Signature

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

> Does someone know how to add items to the Error List in VS 2005?
> Would someone have a code sample on how to add items to the Task List of
> VS2005 as well?
>
> Fabrice
Fabrice Marguerie - 22 Nov 2005 13:20 GMT
Thanks Carlos.
I've managed to do this, and this is what I use with VS2003 to report
compilation errors. Unfortunately, in VS2005 this adds a task to the task
list under the "Add-ins and Macros" category, but does not show it as an
error.
In VS2005 I believe I need to get access to some Add method for the
ErrorList object, but I haven't found out how yet. Please help!

Fabrice

> Once you get the EnvDTE.Window object (I assume that you know this part),
> Window.Object returns an object that, depending on the window, you can
[quoted text clipped - 7 lines]
>>
>> Fabrice
Carlos J. Quintero [VB MVP] - 22 Nov 2005 14:59 GMT
I think that it is not possible to add errors to the list using an add-in in
VS 2005. The collection lacks an Add method. You can submit a suggestion to
add it in the next version:

http://lab.msdn.microsoft.com/ProductFeedback/

Signature

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

> Thanks Carlos.
> I've managed to do this, and this is what I use with VS2003 to report
[quoted text clipped - 5 lines]
>
> Fabrice
"Ed Dore [MSFT]" - 28 Nov 2005 17:59 GMT
Hi Frabrice,

To add items to the error list, you'll need to construct an
ErrorListProvider that implements the IVsTaskProvider interface, as well as
a class that implements IVsErrorItem, as documented in the Visual Studio
SDK for VS 2005. The Managed Package Framework contains some classes that
do all the heavy lifting for you.

In particular the ErrorListProvider and ErrorTask classes in the
Microsoft.VisualStudio.Shell.dll assembly. I have a simple toolwindow
package created with the Visual Studio SDK, that illustrates how to use
these classes to add error items to the Error List dialog. I suspect you
can readily use the same technique from an addin, by referencing the
appropriate MPF assemblies, and retrieving the IServiceProvider interface
from the DTE object.

If you're interested, feel free to drop me an email (just remove that
'.online' from my email address), and I'll zip up and send along the actual
package I wrote that uses these classes. The package in question implements
a toolwindow that you can add errors from, and also handles the ErrorTask's
Navigate event, which reactivates my toolwindow and selects the appropriate
element in a .net listbox that corresponds to the error added to the Error
List.

Sincerely,
Ed Dore [MSFT]

This post is "AS IS" with no warranties, and confers no rights.
bosske - 26 Nov 2007 10:42 GMT
hi,
I am trying to make something similar in VS Orcas and I would like to see
that example if its possible?

>Hi Frabrice,
>
[quoted text clipped - 24 lines]
>
>This post is "AS IS" with no warranties, and confers no rights.
weiwoo - 10 Dec 2007 06:29 GMT
Nice to meet you.

I have the same problem with creating ErrorTask by ErrorListProvider.
Would you like to sent  your hint source to me too?
thank you advanced.

It's so loon time from this thread has been written.
I Bless Good Luck.

yours weiwoo.

>Hi Frabrice,
>
[quoted text clipped - 24 lines]
>
>This post is "AS IS" with no warranties, and confers no rights.
weiwoo - 10 Dec 2007 07:38 GMT
I made it!
Thank you all.

My source writted with Visual Basic .Net is flowing.
---------------------------
                   Dim IServiceProvider As New ServiceProvider(CType
(_applicationObject.DTE, Microsoft.VisualStudio.OLE.Interop.IServiceProvider))

                   Dim ErrorListProvider As New ErrorListProvider
(IServiceProvider)
                   Dim task As New Microsoft.VisualStudio.Shell.ErrorTask
                   task.Text = "Special Error"
                   ErrorListProvider.Tasks.Add(task)
                   ErrorListProvider.Show()
---------------------------

>Nice to meet you.
>
[quoted text clipped - 12 lines]
>>
>>This post is "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.