询问者
异常Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteException 怎么处理?

问题
-
在打开vs的时候就可以加载xaml,但是当运行一次metro程序之后,xaml就加载异常了?有人遇到过这种情况么?
Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteException
Set connectionId threw an exception.
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at Microsoft.Expression.DesignSurface.UserInterface.PlatformPane.PlatformPane.InitializeComponent()
at Microsoft.Expression.DesignSurface.UserInterface.PlatformPane.PlatformPane..ctor(DesignerContext context)
at Microsoft.Expression.DesignSurface.UserInterface.WindowContext.<.ctor>b__b()
at Microsoft.Expression.DesignSurface.UserInterface.WindowContext.GetToolWindow(String identifier)
at Microsoft.Expression.DesignSurface.DesignerService.GetToolWindow(String identifier)
at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass10.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.GetToolWindow>b__f()
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass19`1.<MarshalIn>b__18()
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.Invoke()
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.InvokeCall(Call call)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.ProcessQueue(CallQueue queue)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.ProcessInboundQueue(Int32 identity)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.OnWindowMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at Microsoft.Expression.DesignHost.Isolation.Remoting.MessageOnlyHwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at Microsoft.Expression.DesignHost.Isolation.IsolationProcess.RunApplication()
at Microsoft.Expression.DesignHost.Isolation.IsolationProcess.DesignProcessViewProvider.<>c__DisplayClass7.<applicationView_Activated>b__6()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteException
无法将类型为“System.Windows.Controls.CheckBox”的对象强制转换为类型“Microsoft.Expression.Utility.ValueEditors.ChoiceEditor”。
at Microsoft.Expression.DesignSurface.UserInterface.PlatformPane.PlatformPane.System.Windows.Markup.IComponentConnector.Connect(Int32 connectionId, Object target)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetConnectionId(Object root, Int32 connectionId, Object instance)
全部回复
-
帮忙确认你的项目的语言是什么?OS的版本和VS的版本?
因为类似的问题已经出现了好多次,可以尝试下Reload Project或者下面的workaround http://blendinsider.com/xaml/known-issue-xaml-designer-in-visual-studio-11-beta-crashes-on-launch-2012-03-07/
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
- 已建议为答案 john_shen 2012年8月6日 2:34