I am getting the following exception for code that used to work in silverlight 3 but has stopped working since upgrading to silverlight 4: