4

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)

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.

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.

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...

VS designer exception

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 http://go.microsoft.com/fwlink/?LinkId=155569. à Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.DirectInvoke[T](WaitHandle abort, Func1 func) à Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle1 targetObject, Func1 func) à Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle1 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)

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 http://go.microsoft.com/fwlink/?LinkId=155569.

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](Func1 func, WaitHandle aborted) at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject, Func1 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[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: à System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) à System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) à Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor) à Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass8.b__7(IRemoteDesignerService d) à Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass42.<MarshalOut>b__3() à Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.DirectInvoke[T](WaitHandle abort, Func1 func)

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 http://go.microsoft.com/fwlink/?LinkId=155569. at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence) at System.Reflection.Assembly.LoadFile(String path) at Microsoft.Expression.Utility.AssemblyHelper.LoadFile(String path)
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(IEnumerable1 referencesToUpdate) at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver..ctor(IHostProject project, DesignerContext designerContext) at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyService.<.ctor>b__0(IHostProject project) at Microsoft.Expression.Utility.Collections.SuspendableKeyedCollection2.CreateItems(TKey key) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Expression.Utility.Collections.SuspendableKeyedCollection2.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.<GetContextsInActiveSolution>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.<>c__DisplayClass9.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__8() at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.CallQueue.<>c__DisplayClassa1.b__9() at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.CallQueue.Call.Invoke()

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Olivier
  • 5,578
  • 2
  • 31
  • 46
  • I guess that's why it's still in beta. Report this issue to Microsoft tout suite! – Bernard Mar 13 '12 at 21:29
  • Usually this happens when you try to access an assembly downloaded from the web, which has to be unblocked first. See [here](http://msdn.microsoft.com/en-us/library/ee890038.aspx) for more. In that special case as it's still beta and if no custom assemblies are involved, i could imagine that MS forgot to unblock it's own assemblies (which ever that may be in that case). – nik Mar 14 '12 at 01:08
  • I thought about it. But is there a way to know which assembly it could be ? May VS be logging it somewhere ? I tried to catch the exception attaching another instance of VS to the first one, but obviously Microsoft.Expression.DesignHost.dll (dll throwing the exception) is optimized, thus I cannot gather information about local variables when exception is caught :-/ – Olivier Mar 14 '12 at 10:51
  • FYI, the product does not have an official name yet. When it does, it will not be "Visual Studio 2011" (a past year). The "11" in "Visual Studio 11" refers to the version number (Visual Studio 2010 was version 10; VS2008 was version 9). – John Saunders Mar 20 '12 at 15:50

1 Answers1

3

I appear to have fixed things by setting loadFromSources to enabled as described here:

  1. Go to C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE
  2. Open the files XDesProc.exe.config, devenv.exe.config, and XDesProc.exe.appx.config using a text editor (likely requires administrator mode)
  3. Find </runtime> and before it, add <loadFromRemoteSources enabled="true"/> (If you copy/paste, make sure the doublequotes come through as ASCII or VS will have a fit)

(Source: http://www.sehajpal.com/index.php/2010/10/how-to-solve-loadfromremotesources-error-in-vs-2010/)

Perhaps it is only really necessary to do this for XDesProc.exe.config, I don't know.


After that, I got a different error, Method not found: 'Boolean Microsoft.Windows.Design.PropertyEditing.PropertyFilter.get_IsFiltering()' :

Fix: Copy the file Microsoft.Windows.Design.Interaction.dll from c:\Program Files (x86)\Microsoft Expression\Blend for Visual Studio\Microsoft.Windows.Design.Interaction\ to c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\ (You may wish to make a backup of the existing file first.)

(Source: http://connect.microsoft.com/VisualStudio/feedback/details/728263/xaml-editor-reports-unexpected-error-microsoft-expression-designhost-isolation-remoting-remoteexception)

Someone from Microsoft said installing the Beta over the Developer Preview isn't supported so maybe that's why I had this 2nd problem.

Jared Thirsk
  • 1,237
  • 17
  • 17
  • Thanks ! Solved it! (And you were right: The second part was not useful for me) – Olivier Apr 09 '12 at 10:48
  • what is very strange here is that it happens at random. and now all the time despite having the correct .config startup file. this security model is a disaster. – nicolas May 04 '12 at 07:28
  • I added that to all the config mentioned "XDesProc.exe.config, devenv.exe.config, and XDesProc.exe.appx.config", and it worked. If you answer my question here, I'll grant you some points http://stackoverflow.com/questions/10224585/loadfromremotesources-enabled-true-xaml-designer-vs-11-beta-and-2012-rc – nicolas Aug 06 '12 at 13:03