添加Pivot和其他Microsoft.Phone控件时,Designer会抛出异常HRESULT E_FAIL [英] Designer throws exception HRESULT E_FAIL when adding Pivot and other Microsoft.Phone controls

查看:54
本文介绍了添加Pivot和其他Microsoft.Phone控件时,Designer会抛出异常HRESULT E_FAIL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在StackOverflow上发布了这个问题,但没有得到任何帮助:  http://stackoverflow.com/questions/13595390/visual-studio-2012-xaml-ui-designer-throws-exception-when-adding-pivot-和其他

I've posted this question over at StackOverflow but gotten no help: http://stackoverflow.com/questions/13595390/visual-studio-2012-xaml-ui-designer-throws-exception-when-adding-pivot-and-other





每当我将任何控件添加到Microsoft.Phone命名空间(Pivot,Panorama等)中的Windows Phone 8应用程序时,XAML设计器都会抛出:



< span style ="font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif; font-size:14px; line-height:18px; background-color:#eeeeee">错误HRESULT E_FAIL已被退回从调用COM组件。
$


堆栈跟踪似乎有所不同,这是在文档大纲中选择Panorama后的跟踪:

Whenever I add any control to my Windows Phone 8 App that is in the Microsoft.Phone namespace (Pivot, Panorama, etc.), the XAML Designer throws:

Error HRESULT E_FAIL has been returned from a call to a COM component.

The stack traces seem to differ, here is the trace after selecting the Panorama in the Document Outline:

at Microsoft.Phone.Controls.Design.PanoramaItemAdorner.Activate(ModelItem item)
   at Microsoft.Windows.Design.Interaction.AdornerProvider.InvokeActivate(EditingContext context, ModelItem item)
   at MS.Internal.Features.AdornerProviderFeatureConnector.FeatureProvidersAdded(ModelItem item, IEnumerable`1 extensions)
   at Microsoft.Windows.Design.Policies.PolicyDrivenFeatureConnector`1.OnPolicyItemsChanged(Object sender, PolicyItemsChangedEventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Microsoft.Windows.Design.Policies.ItemPolicy.OnPolicyItemsChanged(PolicyItemsChangedEventArgs e)
   at Microsoft.Windows.Design.Policies.SelectionPolicy.OnSelectionChanged(Selection newSelection)
   at Microsoft.Windows.Design.ContextItemManager.SubscribeProxy`1.SubscribeContext(ContextItem item)
   at Microsoft.Windows.Design.SubscribeContextCallback.Invoke(ContextItem item)
   at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.OnItemChanged(ContextItem item)
   at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.SetValue(ContextItem value)
   at Microsoft.Expression.DesignSurface.ViewModel.Extensibility.ExtensibilityManager.SetSelection(Selection selection)
   at Microsoft.Expression.DesignSurface.ViewModel.Extensibility.ExtensibilityManager.OnViewModelEarlySceneUpdatePhase(Object sender, SceneUpdatePhaseEventArgs args)
   at Microsoft.Expression.DesignSurface.ViewModel.SceneUpdatePhaseEventHandler.Invoke(Object sender, SceneUpdatePhaseEventArgs args)
   at Microsoft.Expression.DesignSurface.ViewModel.SceneViewModel.FireEarlySceneUpdatePhase(SceneUpdatePhaseEventArgs args)
   at Microsoft.Expression.DesignSurface.Pipeline.SceneViewUpdateScheduleTask.UpdateEarly()
   at Microsoft.Expression.Utility.Scheduler.ScheduleTask.Update()
   at Microsoft.Expression.Utility.Scheduler.SchedulingService.DispatchTasksAtPriority(DispatcherPriority priority)
   at Microsoft.Expression.Utility.Scheduler.SchedulingService.DispatcherToken.Dispatch(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

如果文件加载了控件,堆栈跟踪如下所示:

If the file is loaded with the controls, the stack trace looks like:

at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.Collection_InsertValue[T](PresentationFrameworkCollection`1 collection, UInt32 index, CValue value)
   at MS.Internal.XcpImports.Collection_InsertDependencyObject[T](PresentationFrameworkCollection`1 collection, UInt32 index, DependencyObject value)
   at System.Windows.PresentationFrameworkCollection`1.InsertDependencyObject(Int32 index, DependencyObject value)
   at System.Windows.Controls.UIElementCollection.InsertInternal(Int32 index, UIElement value

相同.xaml文件在Blend中工作得很好,设计师在删除控件后立即重新开始工作。



我尝试卸载/修复Windows Phone 8 SDK, Visual Studio,以及Silverlight SDK和Runtimes(此主题中的所有解决方案  http://social.msdn.microsoft.com/Forums/en-US/wptools/thread/7398ad5e-c2fc-40a8-85e7-37e6a6cca834

The same .xaml file works just fine in Blend, and the designer starts working again as soon as the control is removed.

I've tried uninstalling/repairing the Windows Phone 8 SDK, Visual Studio, and the Silverlight SDKs and Runtimes (all the solutions in this thread http://social.msdn.microsoft.com/Forums/en-US/wptools/thread/7398ad5e-c2fc-40a8-85e7-37e6a6cca834)

它似乎与解决方案中其他项目的引用有关:我有一个Windows Phone 8项目,它引用了一些可移植的类库项目(包含MVVM框架,视图模型和与Windows 8应用程序共享的模型) 。如果
我直接添加对项目的引用,则会发生错误,但如果我构建库并引用DLL,则它可以正常工作。它并不理想,但它现在似乎正在起作用。

It seems to be related to references to other projects in the solution: I have a Windows Phone 8 project that references a few portable class library projects (which contain the MVVM framework, viewmodels, and models for sharing with a Windows 8 app). If I add the reference to the project directly the error occurs, but if I build the libraries and reference the DLLs it works fine. It's not ideal, but it seems to be working for now.

此外,有时如果我删除引用,清理解决方案并重建,然后逐个添加对项目的引用将工作,但只有重新启动Visual Studio或XDesProc.exe。

Also, sometimes if I delete the references, clean the solution and rebuild, then add the references to the projects one by one it will work, but only until Visual Studio or XDesProc.exe are restarted.

任何想法?

推荐答案

我遇到了同样的问题。微软的某个人(WinPhone  8 SDK)可以报告这个吗?
I am experiencing the same issue. Can someone from Microsoft (WinPhone 8 SDK) report back on this?


这篇关于添加Pivot和其他Microsoft.Phone控件时,Designer会抛出异常HRESULT E_FAIL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆