David Connell

Software Developer - Red Gate Software

Adding your own .NET exceptions to Visual Studio

Published Monday, January 09, 2006 1:01 PM

You can easily add your own exceptions into Visual Studio so that you do not need to add them in each time into your project when debugging your code.

I have only checked this against Visual Studio 2003, but it looks like it would works the same in Visual Studio 2000 and Visual Studio 2005. BR>Start up regedit and go to

My Computer\HKLM\SOFTWARE\Microsoft\VisualStudio\7.1\
AD7Metrics\Exception\{449EC4CC-30D2-4032-9256-EE18EB41B62B}

Then

  • add in the new Folder, eg MyCustomExceptions.
  • Add in two DWORD keys, State and Code.
  • Now add in the new exceptions as folders each with their own keys of State and Code.
    Here is an example registry exported file for two exceptions generated by the ANTLR system…

    
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AD7Metrics\
    Exception\{449EC4CC-30D2-4032-9256-EE18EB41B62B}\
    Common Language Runtime Exceptions\Antlr] "Code"=dword:00000000 "State"=dword:0000000c [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AD7Metrics\
    Exception\{449EC4CC-30D2-4032-9256-EE18EB41B62B}\
    Common Language Runtime Exceptions\Antlr\antlr.MismatchedTokenException] "Code"=dword:00000000 "State"=dword:0000000c [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AD7Metrics\
    Exception\{449EC4CC-30D2-4032-9256-EE18EB41B62B}\
    Common Language Runtime Exceptions\Antlr\antlr.NoViableAltException] "Code"=dword:00000000 "State"=dword:0000000c
  • Comments

    No Comments
    You need to sign in to comment on this blog

















    <January 2006>
    SuMoTuWeThFrSa
    25262728293031
    1234567
    891011121314
    15161718192021
    22232425262728
    2930311234
    On the Trail of the Expanding Databases
     It is sometimes difficult for other IT people to understand the constraints that DBAs have to work... Read more...

    SQL Server 2008: The New Data Types
     Brad continues his helicopter-level view of the most interesting new features of SQL Server 2008 with a... Read more...

    Reporting on Mobile Device Activity Using Exchange 2007 ActiveSync Logs
     In this new column giving practical advice on all things Sys Admin related, Ben Lye takes on the often... Read more...

    The Bejeweled Puzzle in SQL
     Alex Kozak provides another SQL puzzle to hone your SQL Skills with.  Read more...

    Using Powershell to Generate Table-Creation Scripts
     For all of us who learn best by trying out examples, Bob Sheldon produces a PowerShell script file for... Read more...