Browse Blog Posts by Tags

Showing related tags and posts for the Blogs application. See all tags in the site
  • String.IsNullOrEmpty : update on that nasty null reference exception

    Back in April 2006, I blogged about a nasty JIT compiler optimisation that would cause String.IsNullOrEmpty to throw a null reference exception;  ironic really given that is the very thing you’d use the IsNullOrEmpty method to check against.  Well since then, due to popular demand on the connect...
    Posted to @ Head by bill on Tue, Mar 10 2009
    Filed under: Filed under: , , , , , , ,
  • More on XML Namespaces in VB....

    A couple of weeks ago I wrote about XML Namespace issues in VB: one in particular was to do with namespace declarations being repeated in the output X ML. In those cases we only looked at common namespaces for the entire document. However the example of creating a word document I posted earlier today...
    Posted to @ Head by bill on Sun, Dec 9 2007
    Filed under: Filed under: , , ,
  • Don't "p" on your XAttributes..

    If you programmatically add attributes with namespaces to an XElement, when the XElement is written out it will give each attribute a namespace prefix and then define a xmlns for that prefix. The way XElement does this is first it examines the namespaces already active and also those defined in the element...
    Posted to @ Head by bill on Mon, Nov 26 2007
    Filed under: Filed under: , , , ,
  • XML namespace prefix 'xmlns' is not defined

    When working with VB9 you may get this cryptic error : XML namespace prefix 'xmlns' is not defined If you are using only default namespaces you can fix this by including a definition for the xmlns as an Import statement or as an xmlns attribute on the XML literal. But if you are using prefixed...
    Posted to @ Head by bill on Sat, Nov 24 2007
    Filed under: Filed under: , , , ,
  • Cleaning up your XML literal namespaces

    If you use XML literals in your code, adding one to another: Dim e1 = <a:books></a:books> dim e2 = <a:book></a:book> e1.Add(e2) You will have the xmlns declaration repeated in each of the elements, when really it is only needed once per the document or outer element. The problem...
    Posted to @ Head by bill on Fri, Nov 23 2007
    Filed under: Filed under: , , , , ,
  • What a nasty compiler bug !!

    Kathleen has posted about a real nasty bug in the VB 9 (VB 2008) compiler. And I mean nasty !! The compiler won't warn you, won't give an error of any sort.. it will just omit lines of code from your application ! Yep, it will compile as if nothing is wrong, yet it will remove your code !! If...
    Posted to @ Head by bill on Tue, Nov 20 2007
    Filed under: Filed under: , , , ,
  • Bug in XML literals around the Imports keywords..

    In VB9, there's a bug when using XML literals with any type member that is a protected keyword. For example, given the following psuedo types, Class Doc Public Property [Imports]() As List( Of DocImports) End Class Class DocImports Public Property [Namespace]() As String End Class The following code...
    Posted to @ Head by bill on Tue, Nov 20 2007
    Filed under: Filed under: , , , , ,
Page 1 of 1 (7 items)