none
设计器 An Unhandled Exception has occured 未经处理的异常 求解! RRS feed

  • 问题

  • 本人初次尝试开发Windows phone8.1,搭建完开发环境后不管是在VS2013还是VS2015中,新建空白Windows phone应用总会在XAML设计器中遇到异常,但如果创建通用应用,Windows8.1应用可以正常打开设计器,wp却依旧失败。下图左侧为Windows8.1,右侧为报出异常的wp。 电脑系统是win10,已经重置两次,也没有解决问题。启用Blend也是一样的异常。但是模拟器是可以正常运行的。

    图片均来自vs2013 community with update 5


    在此提前向任何建议表示感谢!

    以下为设计器异常信息:

    An Unhandled Exception has occured

    Click here to reload the designer

    Details:

    Windows.UI.Xaml.Markup.XamlParseException
    XAML parsing failed.
       at Windows.UI.Xaml.Application.LoadComponent(Object component, Uri resourceLocator)
       at Microsoft.Expression.WindowsXamlPhonePlatform.InstanceBuilders.StatusBarStandIn..ctor()
       at Microsoft.Expression.WindowsXamlPhonePlatform.InstanceBuilders.WindowsXamlPhoneOverlayLayer..ctor()
       at Microsoft.Expression.WindowsXamlPlatform.Views.WindowsXamlPhoneImageHost.WindowsXamlPhoneSceneWrapper.CreateOverlayLayer()
       at Microsoft.Expression.WindowsXamlPlatform.Views.WindowsUIXamlImageHost.WindowsXamlSceneWrapper..ctor()
       at Microsoft.Expression.WindowsXamlPlatform.Views.WindowsXamlPhoneImageHost.CreateSceneWrapper()
       at Microsoft.Expression.WindowsXamlPlatform.Views.WindowsUIXamlImageHost.get_RootInstanceWrapper()
       at Microsoft.Expression.WindowsXamlPlatform.Views.WindowsUIXamlImageHost.get_OverlayLayer()
       at Microsoft.Expression.WindowsXamlPlatform.Views.WindowsXamlSceneView.get_OverlayLayer()
       at Microsoft.Expression.WindowsXamlPhonePlatform.UserInterface.PlatformPane.WindowsXamlPhonePlatformPaneModel.UpdateStatusBarVisibility()
       at Microsoft.Expression.DesignSurface.UserInterface.PlatformPane.PlatformPaneModel.set_SceneViewContract(SceneViewContract value)
       at Microsoft.Expression.WindowsXamlPlatform.UserInterface.PlatformPane.WindowsUIXamlPlatformPaneModel.UpdateContract()
       at Microsoft.Expression.WindowsXamlPlatform.UserInterface.PlatformPane.WindowsUIXamlPlatformPaneModel.OnSubscriptionBasisNodeInserted(SceneNode newBasisNode, DocumentNode basisContent)
       at Microsoft.Expression.DesignSurface.UserInterface.PlatformPane.PlatformPaneModel.Subscription_BasisNodeInserted(Object sender, SceneNode newBasisNode, DocumentNode basisContent)
       at Microsoft.Expression.DesignSurface.ViewModel.SceneNodeSubscription`2.OnBasisNodeInserted(BasisNodeHolder holder)
       at Microsoft.Expression.DesignSurface.ViewModel.SceneNodeSubscription`2.SetBasisNodesWorker(SceneViewModel viewModel, DocumentNodeMarkerSortedListOf`1 newBasisNodeList)
       at Microsoft.Expression.DesignSurface.ViewModel.SceneNodeSubscription`2.SetBasisNodes(SceneViewModel viewModel, IEnumerable`1 basisNodes)
       at Microsoft.Expression.DesignSurface.UserInterface.PlatformPane.PlatformPaneModel.set_ActiveView(IDeviceOptionsView value)
       at Microsoft.Expression.DesignSurface.UserInterface.PlatformPane.PlatformPaneService.GetModel(SceneView sceneView, Boolean setActiveView)
       at Microsoft.Expression.DesignSurface.UserInterface.PlatformPane.PlatformPaneService.UpdateActiveModel(SceneView view)
       at Microsoft.Expression.DesignSurface.UserInterface.PlatformPane.PlatformPaneService.DocumentViewContext_ActiveViewChanged(Object sender, ViewChangedEventArgs e)
       at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
       at Microsoft.Expression.DesignSurface.DocumentViewContext.OnActiveViewChanged(ViewChangedEventArgs e)
       at Microsoft.Expression.DesignSurface.DocumentViewContext.SetActiveDocumentAndView(SceneView view, Item item, HostViewEventArgs e)
       at Microsoft.Expression.DesignSurface.DocumentViewContext.SetActiveView(SceneView view, HostViewEventArgs e)
       at Microsoft.Expression.DesignSurface.DocumentViewContext.CreateAndOpenViewInternal(SceneDocument document, CancellationToken cancelToken, Boolean activate, Boolean ensureOpenInHost)
       at Microsoft.Expression.DesignSurface.DesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass13.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__12(CancellationToken cancelToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass3`1.<MarshalInWithCancellation>b__2()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
    Windows.UI.Xaml.Markup.XamlParseException
    XAML parsing failed.
    Server stack trace: 
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalInSynchronous(Action action, Int32 targetApartmentId, CancellationToken cancelToken, CallModality callModality, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId, CancellationToken cancelToken, CallSynchronizationMode syncMode, CallModality callModality, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action, CancellationToken cancelToken, CallSynchronizationMode syncMode, CallModality callModality, ApartmentState apartmentState, String memberName, String filePath, Int32 lineNumber)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.MarshalInWithCancellation[TResult](IRemoteCancellationToken remoteToken, Func`2 func, ApartmentState apartmentState)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostProject remoteProject, IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken remoteToken)
       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]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostProject remoteProject, IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken cancelToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CreateDesignerImpl(IRemoteDesignerService ds, IHostSourceItem item, IHostTextEditor editor, RemoteCancellationToken remoteCancelToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass19.<Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner>b__18(IRemoteDesignerService ds, RemoteCancellationToken remoteToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass5`1.<MarshalOutWithCancellation>b__4(IRemoteDesignerService ds)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass1`1.<MarshalOut>b__0()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
    Windows.UI.Xaml.Markup.XamlParseException
    XAML parsing failed.
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal, CancellationToken cancelToken, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, CancellationToken cancelToken, CallSynchronizationMode syncMode, WaitHandle timeoutSignal, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action, CancellationToken cancelToken, CallSynchronizationMode syncMode, ApartmentState apartmentState, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action`1 action, CancellationToken cancelToken, CallSynchronizationMode syncMode, ApartmentState apartmentState, String methodName, String filePath, Int32 lineNumber)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.MarshalOutWithCancellation[TResult](CancellationToken cancelToken, Func`3 func, ApartmentState apartmentState)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
       at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)
    2018年8月11日 4:52

答案

  • 你好:

    请问你的操作系统是Windows 10 1803?

    很多人在Windows 10 1803上遇到和你一样的问题,这个反馈已经提交给微软产品组了。不过你也可以在visual studio里,单击“帮助”|“发送反馈”|“报告问题”。

    https://msdn.microsoft.com/zh-cn/library/mt632287.aspx


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • 已标记为答案 嶪海 2018年8月15日 1:02
    2018年8月14日 3:26

全部回复

  • 你好:

    请问你的操作系统是Windows 10 1803?

    很多人在Windows 10 1803上遇到和你一样的问题,这个反馈已经提交给微软产品组了。不过你也可以在visual studio里,单击“帮助”|“发送反馈”|“报告问题”。

    https://msdn.microsoft.com/zh-cn/library/mt632287.aspx


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • 已标记为答案 嶪海 2018年8月15日 1:02
    2018年8月14日 3:26

  • 感谢你提供的信息!操作系统正是Windows 10 1803这使我可以从无用的反复尝试中得以解脱。

    我尝试使用hyper-v安装了Windows 10 1709,并安装了vs2013,结果一切正常!

    • 已编辑 嶪海 2018年8月15日 4:19
    2018年8月15日 1:02
  • 说一句技术之外的话,Windows Phone是微软明确要放弃的技术,不建议学习。

    手机开发,还是Java Eclipse/Android Studio更方便直接。


    专注于.NET ERP/CRM开发框架,C/S架构,SQL Server + ORM(LLBL Gen Pro) + Infragistics WinForms

    2018年8月16日 0:19