title: Silverlight application broken with FileNotFoundException in System.Windows.Controls
body: <p>I've been working on converting a Silverlight project from Silverlight 2 to Silverlight 3. Note that I've <strong>never had SL 2</strong> binaries or development components installed on my machine (it's only a month old).</p>
  
  <p>This has been going fine and the app was running until I started getting a build error with <code>ValidateXaml</code> raising a <code>FileNotFoundException</code> in <code>System.Core</code>. I don't know why this suddenly started happening but from some searching around the answer seemed to be putting various Silverlight DLLs in the GAC. This did indeed solve the build errors. I didn't try testing to check if the app ran correctly after that.</p>
  
  <p>Some time later I'm trying to run the app again. Now I'm getting yet another <code>FileNotFoundException</code>, this time in <code>System.Windows.Controls</code>. I've tried removing all Silverlight DLLs from the GAC and adding them back in again without any success. Here's the stack trace:</p>
  
  <pre>
  Message: Unhandled Error in Silverlight Application 
  Code: 4004    
  Category: ManagedRuntimeError       
  Message: System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Controls, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
  File name: 'System.Windows.Controls, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
     at MyNamespace.Page.InitializeComponent()
     at MyNamespace.Page..ctor()
     at MyNamespace.App.Application_Startup(Object sender, StartupEventArgs e)
     at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
     at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)     
  </pre>
  
  <p>This entire experience has been very frustrating and I'd love to know <strong>what is causing these problems and how to fix them?</strong></p>