我有一个WPF GUI项目的小解决方案,库项目中的一些业务逻辑,以及使用MbUnit/ Gallio进行测试的项目。到目前为止一切都很顺利。
在我将PostSharp Log4Net诊断工具包通过NuGet添加到它的当前版本2.1.6.4到GUI和库项目中之后,我无法在我的两个测试程序集中运行测试。在没有告诉我什么类型不能加载的情况下,我总是得到一个TypeLoadException。使用Gallio Echo、Gallio Icarus或Visual测试运行程序没有区别。
因此,我玩了一下,并增加了PostSharp-诊断-工具包-Log4Net的测试项目,也。现在,当我尝试运行测试时,我得到了一个PostSharp已经崩溃的消息框,我可以查看错误的详细信息。下面这个有趣的部分告诉我德语中的PostSharp.Toolkit.Diagnostics.LogLevel类型无法加载。但我不知道怎么解决这个问题。
尽管我的另一个测试项目仍然运行良好,而且两个测试项目(当然)都不包含复杂的内容。无法运行的项目引用agsXMPP,该引用仅用于断言设置了xmpp连接对象上的某些属性。我已经尝试删除这个引用以及这些断言,但是这个项目中的所有测试仍然在TypeLoadException中失败。
有什么想法吗?
System.TypeLoadException Der Typ "PostSharp.Toolkit.Diagnostics.LogLevel“in der Assembly "PostSharp.Toolkit.Diagnostics,Version=2.1.0.0,Culture=neutral,PublicKeyToken=null”。在#path中:Zeile 11. bei PostSharp.Toolkit.Diagnostics.Weaver.Log4Net.Logging.Log4NetBackend..ctor() loggingBackendName)在#path中:Zeile 61。bei PostSharp.Toolkit.Diagnostics.Weaver.InstrumentationPlugIn.InitializeBackend() in #path:Zeile 40。bei PostSharp.Toolkit.Diagnostics.Weaver.InstrumentationPlugIn.get_Backend() in #path:Zeile 25。bei PostSharp.Toolkit.Diagnostics.Weaver.Logging.LoggingAspectWeaver.Initialize() in #path:Zeile 29。北海( bei PostSharp.Sdk.AspectWeaver.AspectWeaver.^pFnf8wEt(AspectWeaverTask _0,TypeDefDeclaration _1,TokenType _2) bei PostSharp.Sdk.AspectWeaver.AspectWeaverTask.^lp9i7ZhC(InstructionWriter _0,AspectInstanceInfo _1,StructuredDeclarationDictionary
1 _2) bei PostSharp.Sdk.AspectWeaver.AspectWeaverTask.^5UGcBAoN.^qmgrNmSI(IMetadataDeclaration _0, AspectInstanceInfo _1) bei PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary1.^lNgKC+Z4(IMetadataDeclaration _0,Func3 _1) bei PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary1.^RdBVqi#path bei PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary1.^d+wOzSPF(IMetadataDeclaration _0, Func2 _1) bei PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary1.^+g+TCqVg(TypeDefDeclaration _0, Func2 _1,( Set1 _2) bei PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary1.^fJqG(Func2 _0) bei PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary1.^fJqG(Func`3 _0) bei PostSharp.Sdk.AspectWeaver.AspectWeaverTask.Execute() bei PostSharp.Sdk.Extensibility.Project.ExecutePhase(String相位) bei PostSharp.Sdk.Extensibility.Project.Execute() bei PostSharp.Hosting.PostSharpObject.ExecuteProjects() bei PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation)
发布于 2012-08-10 12:25:23
我仍然不知道出了什么问题,但是在Visual中通过PostSharp包管理器卸载和重新安装用于Log4Net的所有依赖项的NuGet诊断工具包解决了这个问题。
https://stackoverflow.com/questions/11883874
复制相似问题