CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2002
    Location
    Oklahoma
    Posts
    231

    VS Addin. Detecting when Debugging Starts

    Is there a way to detect when a user starts to debug a project and if so, how do you know what the debugging assembly is. I want to display some information to the programmer when they begin debugging...

  2. #2
    Join Date
    Nov 2004
    Posts
    105

    Re: VS Addin. Detecting when Debugging Starts

    HI

    If I understand properly, This is the solution

    first check DEBUG in project properties. This part of code will only run in debug mode

    Code:
    #if DEBUG
    Assembly  a = Assembly.LoadFrom ( assemblyName ) ;
    
            object[]  attributes = a.GetCustomAttributes( true ) ;
    
            if ( attributes.Length > 0 ) {
              Console.WriteLine ( "Assembly attributes for '{0}'..." , assemblyName ) ;
    
              foreach ( object o in attributes )
                Console.WriteLine ( "  {0}" , o.ToString ( ) ) ;
    
    #end if
    Thanks and Regards
    Ravi.Battula

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured