MicrosoftDocs / windows-dev-docs

Conceptual and overview content for developing Windows apps
Creative Commons Attribution 4.0 International
697 stars 1.2k forks source link

Exception in adding InkCanvas wpf #2724

Closed himanshueip closed 3 years ago

himanshueip commented 4 years ago

issue_signature_ink_canvass.txt

[Enter feedback here] Following page https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/modernize-wpf-tutorial-2 I have performed the steps and i faced the following execption while debugging it System.Windows.Markup.XamlParseException HResult=0x80131501 Message='The invocation of the constructor on type 'Microsoft.Toolkit.Wpf.UI.Controls.InkCanvas' that matches the specified binding constraints threw an exception.' Line number '75' and line position '14'. Source=PresentationFramework StackTrace: at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) at ContosoExpenses.Views.ExpenseDetail.InitializeComponent() in C:\Users\max\Source\Repos\AppConsult-WinAppsModernizationWorkshop\Exercise2\01-Start\ContosoExpenses\Views\ExpenseDetail.xaml:line 1 at ContosoExpenses.Views.ExpenseDetail..ctor() in C:\Users\max\Source\Repos\AppConsult-WinAppsModernizationWorkshop\Exercise2\01-Start\ContosoExpenses\Views\ExpenseDetail.xaml.cs:line 27 at ContosoExpenses.Views.ExpensesList.<>c.<.ctor>b__0_1(SelectedExpenseMessage message) in C:\Users\max\Source\Repos\AppConsult-WinAppsModernizationWorkshop\Exercise2\01-Start\ContosoExpenses\Views\ExpensesList.xaml.cs:line 37

Inner Exception 1: TypeInitializationException: The type initializer for 'Microsoft.Toolkit.Wpf.UI.XamlHost.WindowsXamlHostBase' threw an exception.

Inner Exception 2: TypeLoadException: Could not find Windows Runtime type 'Windows.UI.Xaml.Hosting.XamlSourceFocusNavigationReason'.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

mcleanbyron commented 3 years ago

I'm sorry you encountered this issue. I went through the walkthrough steps again and did not encounter this problem. Please confirm that you are following the setup steps and instructions, and if you still encounter the same issue, please report it in the Microsoft.Toolkit.Win32 repo (this is the open source repo where XAML Islands code is being published, and the developers respond to feedback/bugs against the controls there).