If a Silverlight 5 OOB application makes any elevated trust calls, such as Marshal.SizeOf and you try to automate it with Test Studio you will get an error like this: System.MethodAccessException was unhandled by user code Message=Attempt by security transparent method 'FontDialog.FontInteropHelper.ShowFontDialog()' to access security critical method 'System.Runtime.InteropServices.Marshal.SizeOf(System.Object)' failed. StackTrace: at FontDialog.FontInteropHelper.ShowFontDialog() at FontDialog.MainPage.Button_Click(Object sender, RoutedEventArgs e) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags) InnerException: