加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

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

发布时间:2020-12-14 02:13:11 所属栏目:Windows 来源:网络整理
导读:A first chance exception of type ‘System.Windows.Markup.XamlParseException’ occurred in PresentationFramework.dll Additional information: ‘The invocation of the constructor on type ‘filehelpertest.MainWindow’ that matches the specifie

A first chance exception of type
‘System.Windows.Markup.XamlParseException’ occurred in
PresentationFramework.dll
Additional information: ‘The invocation of
the constructor on type ‘filehelpertest.MainWindow’ that matches the
specified binding constraints threw an exception.’ Line number ‘3’ and
line position ‘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;
        }
    }
}

解决方法

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读