William's profileBill PierceBlogLists Tools Help

Blog


    4/18/2006

    Custom ResXFileCodeGenerator

    Dmytro Kryvko has a nice article on a custom resx code generator he wrote that generates public properties rather than the default internal properties.  This makes the code much more resuable for a common resource library.  I have read some posts to this effect and some theories that it can be achieved using some MSBuild wizardry, but nothing definitive or easy.  Dmytro's solution also generates strongly typed methods for any resources that make use of formatting tokens ({0}, {1}, etc.). 
     
    One improvement I would like to see is a parsing of the formatting token and creating a strongly typed PropertyFormat() method.  Example
     
    If my resource named ErrorMessage is defined as "An Error {0} occured at {0:d}", this would generate a method called ErrorMessageFormat(object arg1, DateTime arg2).
     
    Check it out for yourself:
     
    4/5/2006

    Bug in String.IsNullOrEmpty

    I have been developing in .Net 2.0 and use the new String.IsNullOrEmpty everywhere.  Someone uncovered a bug in this method that only surfaces in RELEASE+OPTIMIZED code.  Passing null to the function will cause an exception. 
     
    This should go in the Daily WTF.
     
    Vote on this issue at the M$ Feedback Center to get it resolved as quickly as possible: