title: CS2000: Compiler initialization failed unexpectedly
body: <p>I have a WPF .NET 3.5 SP1 application that is in use on at least hundreds if not thousands of machines at this point.  The application stores a tree structure in XML that is loaded at startup.  As soon as I try to load the xml via serialization, boom.  It only happens on one end user machine.  He has admin rights, plenty of disk space, memory, etc.</p>
  
  <p>Before I disregard it as a machine problem or anti-virus/spyware and get his IT department involved (a painstaking process), I wanted to see if there's a better way to track this down and get more information.  Since XmlSerialization is black boxish, I'm not sure that there's much more that I can do as a developer.  Or can I?</p>
  
  <p>Any tips are appreciated, complete error below.</p>
  
  <blockquote>
    <p>Unable to generate a temporary class
    (result=1). error CS2000: Compiler
    initialization failed unexpectedly --
    'Not enough storage is available to
    complete this operation. '</p>
  </blockquote>
  
  <pre><code>Stack Trace: 
  
     at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
     at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
     at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
     at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)
     at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
     at System.Xml.Serialization.XmlSerializer..ctor(Type type)
     at Internal.Objects.TreeSetItemManager.LoadTreeItems(String fileName) in TreeSetItemManager.cs:line 41
     at SPA.Windows.MasterWindow.OnInitialized(EventArgs e)
  5/28/2009 10:16:20 Message:
  External component has thrown an exception.Details:
     at MS.Win32.UnsafeNativeMethods.ITfThreadMgr.Activate(Int32&amp; clientId)
     at System.Windows.Input.TextServicesContext.RegisterTextStore(DefaultTextStore defaultTextStore)
     at System.Windows.Input.DefaultTextStore.get_Current()
     at System.Windows.Input.TextServicesContext.SetFocusOnDefaultTextStore()
     at System.Windows.Input.InputMethod.EnableOrDisableInputMethod(Boolean bEnabled)
     at System.Windows.Input.TextServicesManager.Focus(DependencyObject focus)
     at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
     at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
     at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew)
     at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
     at System.Windows.Interop.HwndKeyboardInputProvider.FilterMessage(IntPtr hwnd, Int32 message, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)
     at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)
     at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&amp; handled)
     at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
     at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
     at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
  </code></pre>