Archive for 10:16 AM

Alarm: Softwarepatents on the move again

10:16 AM

stopsoftwarepatents.eu petition banner

From a press release of FFII e.V.:

The President of the European Patent Office (EPO), Alison Brimelow, has asked the Enlarged Board of Appeal (EBA) to decide on the interpretation of the European Patent Convention (EPC) regarding the exclusion of software from patentability. The EBA is replacing the European Parliament in order to validate software patents EU-wide without the need of a debate.

We already have signed. You should sign too, to make your voice against modern forms of highwaymens heard! Sign here.

XmlSerializer and Nullable<T>. A recipe.

02:45 PM

When I tried to serialize a class with an Double? property as attribute, XMLSerializer died with its usual and oh-so-unhelpful cascade of InvalidOperationExceptions. The actual error message was:

Cannot serialize member ‘SomeValue’ of type System.Nullable`1[System.Double]. XmlAttribute/XmlText cannot be used to encode complex types.

Since XML attributes have very well-defined null semantics, I was pretty stumped, but soon I found the Allow override for XmlSerializer Nullable<T> attribute behavior feature request on Microsoft Connect:

Unfortunately, this change would be too large to take and would be a new feature rather than a bug fix. We are trying to minimize new feature work in the XmlSerializer, partly to reduce regression risk, and focus our effort on the next-generation serialization technology. Unfortunately, we have decided to resolve this as Won’t Fix.

So I went back the the trusty old *Specified property of XmlSerializer and hacked together a micro-pattern to support Nullable<T> for serialization to an XML attribute:

(more…)