title: WPF designer fails to load in VS 11 beta
body: <p>I'm experiencing a weird error with the visual studio 11 beta WPF designer (i.e. google does not return any results while searching for a part of the stacktrace)</p>
  
  <p>Here is the problem:
  When I create a WPF application project, and then add windows or usercontrols to it, I have no problems editing them in the embedded WPF designer.
  But when I create a WPF user control project, I cannot manage to get it working: I have the weird error I pasted below.</p>
  
  <p>I'm targeting .Net 4.5 ... and my VS is in french (sorry).
  I pasted the text for this question to be searcheable, and an image as well, for readability.</p>
  
  <p>EDIT: I would translate the first part of the error message as (sorry for my english...)
  Trying to load an assembly from a network source, which has implied using the assembly in sandbox mode in previous version of .Net framework. Since this .Net framework version does not activate CAS strategy by default, this loading might be dangerous.
  etc...</p>
  
  <p><img src="https://i.stack.imgur.com/y0sP5.jpg" alt="VS designer exception"></p>
  
  <blockquote>
    <p>System.NotSupportedException Tentative de chargement d'un assembly à
    partir d'un emplacement réseau qui aurait entraîné l'utilisation de
    l'assembly en mode Bac à sable (sandbox) dans les versions antérieures
    du .NET Framework. Cette version du .NET Framework n'activant pas la
    stratégie CAS par défaut, ce chargement peut être dangereux. Si ce
    chargement n'est pas destiné à utiliser l'assembly en mode Bac à sable
    (sandbox), activez le commutateur loadFromRemoteSources. Pour plus
    d'informations, consultez
    <a href="http://go.microsoft.com/fwlink/?LinkId=155569" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkId=155569</a>.    à
    Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.DirectInvoke[T](WaitHandle
    abort, Func<code>1 func)    à
    Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle</code>1
    targetObject, Func<code>1 func)    à
    Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle</code>1
    targetObject, Func`2 func)    à
    Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem
    item, IHostTextEditor editor)    à
    Microsoft.Expression.DesignHost.IsolatedDesignerService.CreateDesignerViewInfo(IIsolationTarget
    isolationTarget, IHostSourceItem item, IHostTextEditor editor,
    CancellationTokenSource cancelSource)</p>
    
    <p>System.NotSupportedException Tentative de chargement d'un assembly à
    partir d'un emplacement réseau qui aurait entraîné l'utilisation de
    l'assembly en mode Bac à sable (sandbox) dans les versions antérieures
    du .NET Framework. Cette version du .NET Framework n'activant pas la
    stratégie CAS par défaut, ce chargement peut être dangereux. Si ce
    chargement n'est pas destiné à utiliser l'assembly en mode Bac à sable
    (sandbox), activez le commutateur loadFromRemoteSources. Pour plus
    d'informations, consultez
    <a href="http://go.microsoft.com/fwlink/?LinkId=155569" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkId=155569</a>.</p>
    
    <p>Server stack trace:     at
    Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.CallQueue.WaitForCompletion(BlockingCall
    call)    at
    Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.CallQueue.Invoke(BlockingCall
    call)    at
    Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.CallQueue.Invoke[T](Func<code>1
    func, WaitHandle aborted)    at
    Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject
    targetObject, Func</code>1 func)    at
    Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem
    remoteItem, IRemoteHostTextEditor remoteEditor)    at
    System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr
    md, Object[] args, Object server, Object[]&amp; outArgs)    at
    System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage
    msg)</p>
    
    <p>Exception rethrown at [0]:     à
    System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
    reqMsg, IMessage retMsg)    à
    System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp;
    msgData, Int32 type)    à
    Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem
    remoteItem, IRemoteHostTextEditor remoteEditor)    à
    Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.&lt;>c__DisplayClass8.b__7(IRemoteDesignerService
    d)    à
    Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.&lt;>c__DisplayClass4<code>2.&lt;MarshalOut&gt;b__3()
    à
    Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.DirectInvoke[T](WaitHandle
    abort, Func</code>1 func)</p>
    
    <p>System.NotSupportedException Tentative de chargement d'un assembly à
    partir d'un emplacement réseau qui aurait entraîné l'utilisation de
    l'assembly en mode Bac à sable (sandbox) dans les versions antérieures
    du .NET Framework. Cette version du .NET Framework n'activant pas la
    stratégie CAS par défaut, ce chargement peut être dangereux. Si ce
    chargement n'est pas destiné à utiliser l'assembly en mode Bac à sable
    (sandbox), activez le commutateur loadFromRemoteSources. Pour plus
    d'informations, consultez
    <a href="http://go.microsoft.com/fwlink/?LinkId=155569" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkId=155569</a>.    at
    System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence
    evidence)    at System.Reflection.Assembly.LoadFile(String path)    at
    Microsoft.Expression.Utility.AssemblyHelper.LoadFile(String path)<br>
    at
    Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.CreateClassicShadowCopy(IHostProject
    project, String assemblySourcePath)    at
    Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.ResolveShadowCopyAssembly(IHostProject
    project, String path)    at
    Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.ResolveAssembly(IHostProject
    project, String path)    at
    Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.GetAssemblyInformation(String
    path)    at
    Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.GetAssemblyInformation(IHostReferenceItem
    reference)    at
    Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.UpdateAssemblyReferences(IEnumerable<code>1
    referencesToUpdate)    at
    Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver..ctor(IHostProject
    project, DesignerContext designerContext)    at
    Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyService.&lt;.ctor&gt;b__0(IHostProject
    project)    at
    Microsoft.Expression.Utility.Collections.SuspendableKeyedCollection</code>2.CreateItems(TKey
    key)    at
    System.Collections.Concurrent.ConcurrentDictionary<code>2.GetOrAdd(TKey
    key, Func</code>2 valueFactory)    at
    Microsoft.Expression.Utility.Collections.SuspendableKeyedCollection<code>2.GetItem(TKey
    key)    at
    Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyService.GetProjectAssemblyResolver(IHostProject
    project)    at
    Microsoft.Expression.DesignSurface.Project.ProjectContextBase.Initialize()
    at
    Microsoft.Expression.DesignSurface.Project.XamlProjectContext.Initialize()
    at
    Microsoft.Expression.DesignSurface.Project.ProjectContextManager.GetProjectContext(IHostProject
    project, IPlatform platform)    at
    Microsoft.Expression.DesignSurface.Project.ProjectContextManager.&lt;GetContextsInActiveSolution&gt;d__20.MoveNext()
    at
    Microsoft.Expression.DesignSurface.Project.XamlProjectContext.get_Application()
    at
    Microsoft.Expression.DesignSurface.Documents.SceneDocument.GetApplicationDocument(IXamlProjectContext
    activeContext)    at
    Microsoft.Expression.DesignSurface.Documents.SceneDocument.get_ApplicationSceneDocument()
    at
    Microsoft.Expression.DesignSurface.DocumentViewContext.CreateAndOpenView(ISourceItemContext
    sourceItem, Boolean activate, Boolean ensureOpen)    at
    Microsoft.Expression.DesignSurface.DesignerService.CreateDesigner(IHostSourceItem
    item, IHostTextEditor editor)    at
    Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.&lt;&gt;c__DisplayClass9.&lt;Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner&gt;b__8()
    at
    Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.CallQueue.&lt;&gt;c__DisplayClassa</code>1.b__9()
    at
    Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.CallQueue.Call.Invoke()</p>
  </blockquote>