1

I just did a clean install of Windows 10 Build 16232 and installed Visual Studio Community 2017 Preview with the UWP, .NET, and Xamarin "default" packages. I create a blank UWP app, placed a TextBox, and... Got an error.

Here's the XAML :

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <TextBox Text="Hello World!"/>
</Grid>

Now, for the error :

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()

Here's what I tried :

  • Debug x86
  • Debug ARM
  • Debug x64
  • Run as Admin
  • chkdsk
  • Reinstall Visual Studio
  • Reinstall Windows 10 Build 16232 (Slow Ring)
  • Install Visual Studio Community 2017
  • Uninstall Xamarin
  • Upgrade to Windows 10 Build 16241 (Fast Ring)

Every other common controls do work, but not that one. How do I make it work? The problem is only in the designer; I can compile the app just fine.

Nato Boram
  • 4,083
  • 6
  • 28
  • 58
  • You seem to be in a _weird_ situation right now. But why **Preview** version of VS 2017 and **Insider** version of Windows 10. You understand that both are kinda of in a beta state, right? Atleast install the stable version of VS 2017 – boop_the_snoot Jul 25 '17 at 05:09
  • @Nobody Yeah, that's what I'm trying to do right now, however, the Community 2017's installation crashes. I have to uninstall everything and re-install only the Community 2017, and it takes a few hours for each modifications. For your question, I do use every beta software available because I'm having fun testing stuff before they're released (and running into all sort of bugs of course). – Nato Boram Jul 25 '17 at 05:17
  • Have fun dealing with this bug then :) Because i don't see a point in coding with beta s/w. Anyways it's your way. But i believe this problem might get solved by using the **stable** build. Hope somebody else from SO would drop a wise solution! – boop_the_snoot Jul 25 '17 at 05:24
  • Install the latest insider build and your issue should go away. – Justin XL Jul 27 '17 at 11:00

1 Answers1

0

Thanks for your feedback. This is a known issue that has been fixed. As @Justin XL said, you can update your System to Windows 10 Insider Preview Build 16251 to solve this issue. This is the latest version now. After upgrading, you may need to clean and rebuild your project and reopen your pages, then the TextBox should be able to show in XAML Designer with on error.

Jay Zuo
  • 15,653
  • 2
  • 25
  • 49