SubMain - CodeIt.Right The First Time!

/Community

Support Community for SubMain Products
 Home Products Services Download Purchase Support
in Search
 
Home Forums Blogs Tutorials/CIR Tutorials/GD Downloads
Welcome to SubMain Community Sign in | Join | Help

Check methods have try catch rule

Last post 02-11-2015, 3:02 AM by Misha Zhutov (SubMain). 1 replies.
Sort Posts: Previous Next
  •  02-10-2015, 8:55 PM 4095

    Check methods have try catch rule

    Do you have some sample code to check if methods have try catch?

    Just started learning how to use custom rule SDK and not having much luck. Tried using code from Protected Methods in aspx file should have try catch ? but just getting errors and missing references.

     

     

     

  •  02-11-2015, 3:02 AM 4096 in reply to 4095

    Re: Check methods have try catch rule

    Hello,

    You can take a look at AvoidControlStatementsWithEmptyBodies class in SubMain.CodeItRight.Rules.Usage.dll. That class is not obfuscated and can be viewed via any reflection tool. You need to set rule target as Method, check that method is protected and placed inside ASPX file and then enumerate all method statements to search for Try statement.

    Please let us know if you need additional help with writing this rule.


     


    Thank you,
    Misha Zhutov
    http://submain.com - .NET Developer Tools | Microsoft VB MVP
View as RSS news feed in XML
 
     
 
Home |  Products |  Services |  Download |  Purchase |  Support |  Community |  About Us |