Tuesday, December 21, 2010

My Bag of Tools for 2011

This is my bag of tools. I need to constantly improve it. I will update my list with new tools. And with replacement which are superior to what on the list already.

Visual Studio Add-ins

.Net Development & Frameworks

Process & Project Managment

Desktop/Browser Utilities

Videos

My ToDo List

Monday, December 13, 2010

WCF readings and downloads

There is a lot of useful blogs out there. And the technology surrounding WCF as a communication line between businesses is growing. But there is also a growing demand for more interacting web pages which can benefeath from this technology. REST, Json and Ajax.

Start reading here:

Thursday, December 02, 2010

'', hexadecimal value 0x1F, is an invalid character.

Using XElement to create html in code behing. Reusing the existing code with new data, the XElement gives this error  trying to access the ToString() method. Obviously the problem was that the new data contains 0x1F character.

From the blog, http://seattlesoftware.wordpress.com/2008/09/11/hexadecimal-value-0-is-an-invalid-character/:
The decimal range for ASCII control characters is 0 – 31, and 127. Or, in hex, 0×00 – 0x1F. The problem that causes these XmlExceptions is that the data being read or loaded contains characters that are illegal according to the XML specifications. Almost always, these characters are in the ASCII control character range (think whacky characters like null, bell, backspace, etc). These aren’t characters that have any business being in XML data; they’re illegal characters that should be removed, usually having found their way into the data from file format conversions, like when someone tries to create an XML file from Excel data, or export their data to XML from a format that may be stored as binary.

This is a very accurate match for this case. The text which contains this character is OCR read from paper as the only source.

The solution was to manually replace this character with a white space, before adding the value to the XElement.

.Replace((char)(0x1F), ' ')


Wish I could do this more generic, with a framework Encode method.