title: .NET-Framework Mismatch 4.0.1/4.5 'System.Runtime.CompilerServices.ExtensionAttribute'
body: <p>A rehosted Workflow Foundation Designer throws an exception while loading a workflow.</p>
  
  <p>The following exception is thrown:</p>
  
  <blockquote>
    <p>System.Xaml.XamlObjectWriterException: 'Failed to create a 'Settings'
    from the text 'Assembly references and imported namespaces for
    internal implementation'.' Line number '1' and line position '135'.</p>
    
    <p>System.TypeLoadException: Could not load type
    'System.Runtime.CompilerServices.ExtensionAttribute' from assembly
    'mscorlib, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=b77a5c561934e089'.</p>
  </blockquote>
  
  <p>This exception appears only on systems with .NET 4.0 Update 1 installed. On computers having .NET 4.5 installed there is no problem at all.</p>
  
  <p>The problem seens to be that 'System.Runtime.CompilerServices.ExtensionAttribute' was moved in .NET 4.5 to mscorlib.dll (formerly located in System.Core.dll).</p>
  
  <p>I have no clue, why it is just searching in mscorlib.dll and not in System.Core.dll as it should in a .NET 4.0 environment.</p>
  
  <p>Any help is highly appreciated.</p>