调用FileHelperEngine构造函数时,PresentationFramework.dll中的XamlParseException

gus*_*gus 4 c# wpf filehelpers visual-studio-2013

PresentationFramework.dll中出现类型'System.Windows.Markup.XamlParseException'的第一次机会异常
附加信息:'对类型'filehelpertest.MainWindow'的构造函数的调用与指定的绑定约束相匹配引发异常.行号"3"和行位置"9".

大家好,

我是FileHelpers的新手.

我在VS Express 2013中制作了一个最小的WPF项目,以便解决这个问题.代码将从FileHelpers文档中的"Quick Start for Delimited files"部分复制.

我试过引用3个不同版本的FileHelpers.dll(2.0,1.1,Mono1.2),我尝试重启.但是我看不到任何影响.必须有一些非常简单的东西,我错过了吗?

或者FileHelpers不适用于较新版本的.NET?

谢谢!

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using FileHelpers;

namespace filehelpertest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            FileHelperEngine engine = new FileHelperEngine(typeof(Customer));
            // To Read Use:
            Customer[] res = engine.ReadFile("f1.txt") as Customer[];
            // To Write Use:
            engine.WriteFile("f2.txt", res);
        }

        [DelimitedRecord(",")]  
        public class Customer
        {
            public int CustId;
            public string Name;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

gus*_*gus 14

我的问题的解决方案与XAML Parse Exception中接受的答案相同- xmlns:x ="http://schemas.microsoft.com/winfx/2006/xaml"

我做了CTRL-ALT-E然后检查了一切.现在,弹出窗口显示实际异常,而不是xamlparseexception.