Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

how to navigate to a file where error is present after adding our own error task ?

$
0
0
Hi all,

I am implementing a vspackage in VS2008.
In this i have to add new kind of errors in to the error list. This I have done as in the following code:

ErrorListProvider errorProvider;
errorProvider = new ErrorListProvider(this);
TaskErrorCategory errorCat= TaskErrorCategory.Error;

ErrorTask newError = new ErrorTask();
                newError.ErrorCategory = errorCat;
                newError.Text = e1.name;
                newError.Line = e1.lineNumber ;
                newError.Column = col ;
                newError.Document = e1.file;
                newError.Navigate += new EventHandler(newError_Navigate);

 errorProvider.Tasks.Add(newError);
 errorProvider.BringToFront();
 errorProvider.Refresh();

then i have implemented the navigate method

void newError_Navigate(object sender, EventArgs e)
        {
          ErrorTask task = (ErrorTask)sender;
            String name = task.Text;
            int lineNumber = task.Line;
            System.Windows.Forms.MessageBox.Show(" You have an error!!");
        }

The Problem is when i double click the error in the error list it doesnt open the corresponding file;
e1.file has the full path of the file as F:\\VisualStudioWorkSpace\\ConsoleApp2\\ConsoleApp2Program.cs  which it is reading from an XMl file.

<error name="first"  lineNumber="25" colNumber="0"
          file="F:\VisualStudioWorkspace\ConsoleApp2\ConsoleApp2\Program.cs">

Is some thing wrong in the code that i am missing???

Thanks for any help.



Viewing all articles
Browse latest Browse all 4410

Trending Articles