Thanks! -----Original Message----- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] Behalf Of Jamie Cansdale Sent: 03/26/2003 13:50 To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] VS.NET add-in question
Hi Stoyan, I've been working on an addin for VS.NET that lets you run unit tests (NUnit and JUnit) and arbitrary methods from inside the source editor. When an exception is thrown a new task is added and the stack trace is written to the output pane. There's a method called 'writeStackTrace' in 'VSTestListener.cs' that does this. You'll find it in SourceForge at... http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/nunitaddin/NUnitAddin/NUn itAddin/TestRunner/VSTestListener.cs?rev=1.1&content-type=text/vnd.viewc vs-markup (sorry about the line wrap) You can find more information about the addin on the project weblog here... http://dotnetweblogs.com/NUnitAddin/Category/177.aspx?Name=NUnitAddin You can download the addin installer from here... http://sourceforge.net/project/showfiles.php?group_id=64706 I hope you can find something of use in there. Let me know how you get on. Good luck, Jamie. -----Original Message----- From: Stoyan Damov [mailto:[EMAIL PROTECTED] Sent: 25 March 2003 15:18 To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] VS.NET add-in question Hi! I'm writing an add-in for VS.NET (2002, not Everett). I subscribe to the OnBuildBegin event, and want to output some errors on the task pane while a solution is being compiled. The tasks show up in the pane, but when I click on a task, it won't jump to the source file's line and column. How do I properly add tasks to the tasks pane in order to navigate from them to the source files? I remember that when a custom tool in VS6 should writes <file name>(line,column) : error message\n then when you click on the line, the IDE jumps to the file/line/column It works for VS.NET too, and I do output the formatted error message, but it won't generate a build error task in the task pane, so it's useless. I'm not in a hurry, as I do this for fun, so take your time:) Thanks, Stoyan P.S. I use the following code to add a task to the task pane: <snippet lang="C#"> Window window = applicationObject.Windows.Item (Constants.vsWindowKindTaskList); TaskList taskList = (TaskList) window.Object; taskList.TaskItems.Add ( vsTaskCategories.vsTaskCategoryBuildCompile, vsTaskCategories.vsTaskCategoryUser, "Some Message\n", vsTaskPriority.vsTaskPriorityHigh, vsTaskIcon.vsTaskIconCompile, false, fileName, ((CodeElement) att.Parent).StartPoint.Line, // ignore this... false, true); </snippet> =================================== This list is hosted by DevelopMentor(r) http://www.develop.com You may be interested in Guerrilla .NET, 24 March 2003, in London and Boston http://www.develop.com/courses/gdotnet View archives and manage your subscription(s) at http://discuss.develop.com
