当多个MasterDetailsView在网格中实例化时,Visual Studio Xaml Designer崩溃并出现COMException [英] Visual Studio Xaml Designer Crash with COMException When Multiple MasterDetailsView instantiated within grid

查看:74
本文介绍了当多个MasterDetailsView在网格中实例化时,Visual Studio Xaml Designer崩溃并出现COMException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2017 v15.3.3和Visual Studio 2017 Preview v15.4.0 Preview 1.0中,当我的代码如下所示时,XAML Designer会崩溃:

In both Visual Studio 2017 v15.3.3 and Visual Studio 2017 Preview v15.4.0 Preview 1.0, XAML Designer will crash when I have a code looks like the following:

<Page xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls">
<Grid> <controls:MasterDetailsView Visibility="Visible"> </controls:MasterDetailsView> <controls:MasterDetailsView Visibility="Collapsed"> </controls:MasterDetailsView> </Grid>
</Page>

当您重新打开项目并出现以下错误消息时,XAML设计器将崩溃:

XAML designer will crash when you reopen the project with following error message:

COMException:错误HRESULT E_FAIL已从调用COM组件返回。

StackTrace:在System.Runtime中为
。 InteropServices.WindowsRuntime.IVector`1.InsertAt(UInt32索引,T值)

   at System.Runtime.InteropServices.WindowsRuntime.VectorToListAdapter.InsertAtHelper [T](IVector`1 _this,UInt32 index,T item)

   at System.Runtime.InteropServices.WindowsRuntime.VectorToListAdapter.Insert [T](Int32 index,T item)

COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
StackTrace:
at System.Runtime.InteropServices.WindowsRuntime.IVector`1.InsertAt(UInt32 index, T value)
   at System.Runtime.InteropServices.WindowsRuntime.VectorToListAdapter.InsertAtHelper[T](IVector`1 _this, UInt32 index, T item)
   at System.Runtime.InteropServices.WindowsRuntime.VectorToListAdapter.Insert[T](Int32 index, T item)

推荐答案

你好leavesw,

Hi leavesw,

感谢您的发布。

这是一个UWP应用吗?

It's an UWP app right?

由于报道了类似的问题,一个解决方案是将目标版本切换到
Windows 10(10.0; Build 10586)如果你没有,那么问题就会消失,设计师会正常显示页面。

As similar issue has been reported, one solution is to switch the target version to Windows 10 (10.0; Build 10586) if yours did not , then the problem goes away and the designer shows the page normally.

 

祝你好运,

Fletcher


这篇关于当多个MasterDetailsView在网格中实例化时,Visual Studio Xaml Designer崩溃并出现COMException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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