Patrick Steele's .NET Blog
Implements ICodeWithDotNet
-
Last Day for DevDays Early Bird Registration
-
Feeding the lawn?
So I'm working on a design document for a class. I hit F7 to check my spelling and grammar and it seems Word wants to change my "Serializable" class to a "Fertilizable" class. No thanks. I'll just add "Serializable" to my dictionary... :)
-
RSS Generator Component
Build an RSS Generator Component. From Visual Studio Magazine:
-
Javascript Calendar
-
Serialization and Inheritence
My problem with my approach in my prototype code was that I inherited from a class that implemented ISerializable. Normal serialization uses reflection to determine the members of an object to serialize (it's dynamic). An object that implements ISerializable usually does so to implement its own serialization -- i.e. not using reflection. Therefore, when you derive from a class that implementes ISerializable, the serialization probably won't see any extra fields/properties you've added to the class (I tested this in my prototype and that is exactly what happened when deriving from Hashtable).
-
Cont'd: Deserialization Problems
Anyone see the big problem with my approach below? I actually thought about this last night but didn't test it until this morning -- and my hunch was right. I'll post more when I get some time at lunch...
-
Deserialization Problems
While prototyping something today, I had an object that I wanted to be able to serialize out to disk. This object was derived from Hashtable, which already implemented the ISerializable interface so I thought I was all set. Serialization worked fine. Then I went to deserialize it and I got the following error:
-
Spirit's problem? Could be buffer overflow.
-
Versioning in .NET
I was doing some prototype work and wanted to investigate versioning issues. I was changing version numbers of some dependent assemblies and not having any problems with .NET finding the right version. I was puzzled at some of my findings so I checked the docs. My bad:
-
C#'s const vs. readonly
A quick synopsis on the differences between 'const' and 'readonly' in C#: