Permalink  CLR, Tips  Comments Off
Aug 222010
 

Last week I replied to a post about exceptions, it made me think those programming .Net daily take for granted the etiquette of using Exceptions. So I thought I would share some of my thoughts… well it is a sort of a rules’ish list.

  • Exceptions can be expensive, so avoid using them for normal conditions
  • Only catch the exceptions you can handle
  • Don’t hide/swallow exceptions
  • Don’t catch System.Exception as will also catch unmanaged exceptions such as System.Runtime.InteropServices.SEHException
  • Consider using your own custom exceptions or derive them from similar ones
  • Remember inner exceptions when processing an exception
  • Use the Exception suffix on your custom exception
  • Consider using Microsoft’s StyleCop to point out common issues
  • Avoid using System.ApplicationException if you want to use the code in the Silverlight CLR
  • Remember to serialize your own exception types
  • Use xml comment docs for the exceptions a method raises… it helps intellisense..

I suspect I might have missed something.. so feel free to comment..

 

Just a quick blog to document a bit of pain I hit with CAPICOM and SIGNTOOL..

I got the following error:

EXEC : SignTool error : Signtool requires CAPICOM version 2.1.0.1 or higher. Please

The solution is to download and install:

  • Platform SDK Redistributable: CAPICOM
  • Then regsvr32 on capicom.dll… eg:


    cd "C:Program Files (x86)Microsoft CAPICOM 2.1.0.2 SDKlibX86"
    C:Program Files (x86)Microsoft CAPICOM 2.1.0.2 SDKLibX86>REGSVR32 capicom.dll

     

    When I first started working on COBOL I was told that COBOL was a business oriented language that even managers could use ;-)

    It looks like Microsoft are wanting to do something similar in a modern manor using Visual Studio + supper duper templates…

    Here is what Computer World UK has to say about “Microsoft Visual Studio LightSwitch”.

    Microsoft turns on Visual Studio LightSwitch

    Visual Studio LightSwitch is easy enough for business managers

    Microsoft is gearing up to release a version of its Visual Studio integrated developer environment that it promises will be easy enough for even business managers to use.

    I understand this is not COBOL but the reasons sound very familiar…

    From: Computer World UK – Microsoft turns on Visual Studio LightSwitch

    Microsoft Visual Studio LightSwitch

    © 2012 The ramblings of a yorkshire tyke Suffusion theme by Sayontan Sinha