Click here to monitor SSC

Software Developer - Red Gate Software

Adding your own .NET exceptions to Visual Studio

Published 9 January 2006 5:01 am
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 ComputerHKLMSOFTWAREMicrosoftVisualStudio7.1
AD7MetricsException{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_MACHINESOFTWAREMicrosoftVisualStudio7.1AD7Metrics
    Exception{449EC4CC-30D2-4032-9256-EE18EB41B62B}
    Common Language Runtime ExceptionsAntlr] “Code”=dword:00000000 “State”=dword:0000000c [HKEY_LOCAL_MACHINESOFTWAREMicrosoftVisualStudio7.1AD7Metrics
    Exception{449EC4CC-30D2-4032-9256-EE18EB41B62B}
    Common Language Runtime ExceptionsAntlrantlr.MismatchedTokenException] “Code”=dword:00000000 “State”=dword:0000000c [HKEY_LOCAL_MACHINESOFTWAREMicrosoftVisualStudio7.1AD7Metrics
    Exception{449EC4CC-30D2-4032-9256-EE18EB41B62B}
    Common Language Runtime ExceptionsAntlrantlr.NoViableAltException] “Code”=dword:00000000 “State”=dword:0000000c
  • Leave a Reply