?
Solved

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

Posted on 2014-11-13
3
Medium Priority
?
106 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
CtrlAltDl earned 2000 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

What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

762 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