typeinitializeexception

    1热度

    1回答

    我正在尝试使用Moles来测试单独程序集中的非静态方法。在没有[HostType(“Moles”)]标签的情况下运行测试时,测试运行良好。当我替换它时,我收到以下错误: “'HtmlAgilityPack.HtmlNode'的类型初始值设定项引发异常。” 我附上了以相同方式执行的代码示例。 任何帮助将是伟大的! 类/方法,通过单元测试被称为 using System; using HtmlAgi

    0热度

    1回答

    System.TypeInitializationException was unhandled Message=The type initializer for 'SmartHomeworkOrganizer.ViewModels.MainViewModel' threw an exception. Source=SmartHomeworkOrganizer TypeName=SmartHome