Debugging .NET Serialization Code

25 02 2008

Just what is your XmlSerializer doing?

You can find out by debugging the serialization code which is generated automatically at runtime;

1. Modify your .config file to include the following snippet

<configuration>
   <system.diagnostics>
      <switches>
         <add name="XmlSerialization.Compilation" value="1" />
      </switches>
   </system.diagnostics>
</configuration>

2. Rebuild your code and set a breakpoint on or just after where you create an instance of the XmlSerializer, but before you call Serialize() or Deserialize().

3. Navigate to the temp directory in your profiles local settings directory

For Vista this is [C:\Users\{user}\AppDataLocalTemp]

For Win XP+ this is [C:\Documents and Settings\{user}\Local Settings\Temp]

4. In Visual Studio, open the most recent .cs file from this folder, set a break point and away you go.
 

Technorati Tags: ,,,,




Windows Live Writer

25 02 2008

Been using this for blogging for a while now, and find it pretty good, even comparable with BlogJet

Get it here…





The Frogs

25 02 2008

The frogs arrived in the pond Friday (22nd February) evening, by Saturday there was plenty of frog spawn, 2 weeks earlier than last year.





Can’t Select Multiple Files in Windows Vista Explorer

18 02 2008




Clear the InfoPath 2007 local form template cache

7 02 2008

When loading an InfoPath form from an intranet/Sharepoint etc, the form template is downloaded and cached locally. Sometimes after the template has been upgraded on the server the local client doesn’t always get the upgraded form template but uses the local cached copy instead.

You can rectify this by clearing the local cache;

Infopath /cache clearall

Verify that the cache has been cleared by navigating to the following folder for XP+

C:\Documents and Settings\[User]\Local Settings\Application Data\Microsoft\InfoPath\FormCache2

Or for Vista;

C:\Users\[User]\AppData\Local\Microsoft\InfoPath\FormCache2

Underneath the FormCache2 folder there will be a folder with a GUID name, check inside here, it should be empty, apart from a file called _SCVer.dat.