Solved

Macro not working in VS.NET 2005 and VS.NET 2008

Posted on 2014-11-13
3
102 Views
Last Modified: 2014-11-18
Dear Experts,

   I've below macro. In VS.NET 2010, I search for some keyword. If I run the macro it will put breakpoints in all the possible lines of result window (Find Result 1 Window). This is not working for VS.NET 2005 and VS.NET 2008. Debugger as well not attaching if I put breakpoint in the macro. Kindly assist to resolve the issue.

Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
Imports System.IO
Imports System.Text.RegularExpressions

Public Module BreakPoint

    Sub BreakPointAtString()

        Dim findResultsWindow As Window = DTE.Windows.Item(Constants.vsWindowKindFindResults1)

        Dim selection As TextSelection
        selection = findResultsWindow.Selection
        selection.SelectAll()



        Dim findResultsReader As New StringReader(selection.Text)
        Dim findResult As String = findResultsReader.ReadLine()

        Dim findResultRegex As New Regex("(?<Path>.*?)\((?<LineNumber>\d+)\):")

        While Not findResult Is Nothing
            Dim findResultMatch As Match = findResultRegex.Match(findResult)

            If findResultMatch.Success Then
                Dim path As String = findResultMatch.Groups.Item("Path").Value
                Dim lineNumber As Integer = Integer.Parse(findResultMatch.Groups.Item("LineNumber").Value)

                Try
                    DTE.Debugger.Breakpoints.Add("", path, lineNumber)
                Catch ex As Exception
                    ' breakpoints can't be added everywhere
                End Try
            End If

            findResult = findResultsReader.ReadLine()
        End While

    End Sub



End Module

Open in new window

0
Comment
Question by:Easwaran Paramasivam
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
CtrlAltDl earned 500 total points
ID: 40443337
I believe the problem is the older VS don't recognize the newer namespaces (EnvDTE100, EnvDTE90).

Both VS2008 and VS2005 should be able to import EnvDTE and EnvDTE80, but not 100, 90, or 90a.

http://msdn.microsoft.com/en-us/library/yf86a8ts%28v=vs.80%29.aspx
0
 
LVL 16

Author Closing Comment

by:Easwaran Paramasivam
ID: 40446642
Great!!
0
 
LVL 16

Author Comment

by:Easwaran Paramasivam
ID: 40449254
@CtrlAltDl - Like putting breakpoints from Search Result is it possible to put breakpoints from Symbol result window? If so, please suggest how to achieve it.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question