Weird exception: "The system cannot find the file specified"

Weird exception: "The system cannot find the file specified"

Old forum URL:

cds posted on Monday, June 07, 2010

Hi All

Looking for wisdom. In my deployed Silverlight app, I see this exception:

System.ComponentModel.Win32Exception: The system cannot find the file specified
   at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D wc_d)
   at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
   at MS.Win32.MessageOnlyHwndWrapper..ctor()
   at System.Windows.Threading.Dispatcher..ctor()
   at System.Windows.Threading.Dispatcher.get_CurrentDispatcher()
   at System.Windows.DependencyObject..ctor()
   at Csla.DataPortal.get_IsInDesignMode()
   at Csla.DataPortal.GetDataPortalProxy(Boolean forceLocal)
   at Csla.DataPortal.Fetch(Type objectType, Object criteria)
   at Csla.DataPortal.Fetch[T](Object criteria)
   at Csla.DataPortal`1.Fetch_DoWork(Object sender, DoWorkEventArgs e)

Any ideas what could cause this?

It seems that the runtime is failing to load an assembly.

The exception is intermittent on a fairly busy system.


RockfordLhotka replied on Tuesday, June 08, 2010

This is a known problem with IsInDesignMode - apparently some bug in the runtime that only shows up under load. There's at least one lengthy thread about this from a few months back, and the issue is resolved in 3.8.2 because I removed the entire design time data concept from CSLA (well, I disabled it in 3.8.2 and removed it entirely in CSLA 4).

You can either upgrade to the current version of CSLA, or alter your older version of CSLA by making IsInDesignMode always return false (remove the code that does the detection).

cds replied on Tuesday, June 08, 2010

Excellent - thanks Rocky. Yes, I'm not yet on the latest CSLA, so I'll make the change to remove that check.



Copyright (c) Marimer LLC