简体   繁体   中英

WPF XAML Parse Exception?

I was working on a WPF application, and it was running fine. I commented out an if check to test something in a utility class, and all of a sudden my program stopped running due to a XAML Parse Exception. The part of the XAML that it points to is the opening tag and to this attribute:

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

The full tag is this:

<Window x:Class="MyApplication.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="Auto" Width="Auto" WindowStartupLocation="CenterScreen" Topmost="False" KeyUp="KeyUpCheck" SizeToContent="WidthAndHeight" ResizeMode="NoResize" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignWidth="441" d:DesignHeight="319">

The exact error is this:

'The invocation of the constructor on type 'MyApplication.MainWindow' that matches the specified binding constraints threw an exception.' Line number '4' and line position '291'.

The attribute is what is generated when I resize the form in the viewport. I'm completely clueless as to why it's giving me this error. Any ideas?

“对'MyApplication.MainWindow' 类型的构造函数的调用......引发了异常” 打开对引发的异常的中断并查看构造函数中正在引发什么异常。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM