我刚刚完成了Windows 10构建16232的干净安装,并使用UWP、.NET和Xamarin“默认”包安装了Visual Community2017预览。我创建了一个空白的UWP应用程序,放置了一个TextBox,然后.出了个错误。
以下是XAML:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBox Text="Hello World!"/>
</Grid>现在,对于错误:
Exception: Unable to create an instance of "TextBox".
at Microsoft.VisualStudio.DesignTools.Designer.InstanceBuilders.InstanceBuilderOperations.InstantiateType(Type type, Boolean supportInternal)
at Microsoft.VisualStudio.DesignTools.Designer.InstanceBuilders.ClrObjectInstanceBuilder.InstantiateTargetType(ILocalInstanceBuilderContext context, ViewNode viewNode)
at Microsoft.VisualStudio.DesignTools.Designer.InstanceBuilders.ClrObjectInstanceBuilder.Instantiate(ILocalInstanceBuilderContext context, ViewNode viewNode)
at Microsoft.VisualStudio.DesignTools.UwpDesigner.InstanceBuilders.FrameworkElementInstanceBuilder.Instantiate(ILocalInstanceBuilderContext context, ViewNode viewNode)
at Microsoft.VisualStudio.DesignTools.Designer.InstanceBuilders.LocalInstanceManager.CreateInstance(IInstanceBuilder builder, ViewNode viewNode)
TargetInvocationException : Exception has been thrown by the target of an invocation.
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
AccessViolationException : Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Windows.UI.Xaml.Controls.TextBox..ctor()以下是我尝试过的:
chkdsk所有其他通用控件都可以执行工作,但这个控件不起作用。我该怎么做呢?问题只出在设计者身上,我可以很好地编译这个应用程序。
发布于 2017-07-28 10:39:58
感谢您的反馈。这是一个已知的问题,已经得到解决。正如@Justin所说,您可以将系统更新为内部版本16251以解决此问题。这是现在的最新版本。升级后,您可能需要清理和重建您的项目并重新打开页面,然后TextBox应该能够在XAML设计器中显示错误。
https://stackoverflow.com/questions/45294047
复制相似问题