我有一个小型解决方案,包括WPF GUI项目,库项目中的一些业务逻辑以及使用MbUnit / Gallio的测试项目。到目前为止一切正常。
在我通过NuGet将当前版本2.1.6.4中的PostSharp Diagnostics Toolkit for Log4Net添加到我的GUI和库项目之后,我无法在我的两个测试程序集中运行测试。我总是得到一个TypeLoadException
告诉我无法加载类型。没有区别可以使用Gallio Echo,Gallio Icarus或Visual Studio测试跑步者。
所以我玩了一下,并将PostSharp-Diagnostics-Toolkit-Log4Net添加到测试项目中。现在,当我尝试运行测试时,我得到一个PostSharp-has-crashed-message-box,我可以查看错误详细信息。以下有趣的部分用德语告诉我,无法加载类型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”konnte nicht geladen werden。 PostSharp.Toolkit.Diagnostics.Weaver.Log4Net bei PostSharp.Toolkit.Diagnostics.Weaver.Log4Net.Logging.Log4NetBackend..ctor()bei PostSharp.Toolkit.Diagnostics.Weaver.Log4Net.Logging.Log4NetBackendProvider.GetBackend(String name)in#路径:Zeile 11. bei PostSharp.Toolkit.Diagnostics.Weaver.InstrumentationPlugIn.GetBackend(String loggingBackendName)in #path:Zeile 61. bei PostSharp.Toolkit.Diagnostics.Weaver.InstrumentationPlugIn.InitializeBackend()in #path:Zeile 40. bei在#path中的PostSharp.Toolkit.Diagnostics.Weaver.InstrumentationPlugIn.get_Backend():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.StructuredDeclarationDictionary
1. ^ lNgKC + Z4(IMetadataDeclaration _0,Func { {1}} 1. ^ RdBVqi#path bei PostSharp.Sdk.A spectInfrastructure.StructuredDeclarationDictionary3 _1) bei PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary
2 _1)bei PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary1.^d+wOzSPF(IMetadataDeclaration _0, Func
2 _1,设置1.^+g+TCqVg(TypeDefDeclaration _0, Func
1. ^ fJqG(Func1 _2) bei PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary
1. ^ fJqG(Func `3 _0)bei PostSharp.Sdk.AspectWeaver.AspectWeaverTask.Execute()bei PostSharp.Sdk.Extensibility.Project.ExecutePhase(String phase)bei PostSharp.Sdk.Extensibility.Project.Execute()bei PostSharp.Hosting.PostSharpObject.ExecuteProjects ()bei PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation)
答案 0 :(得分:0)
我仍然不知道出了什么问题,但是通过Visual Studio中的NuGet包管理器卸载并重新安装Log4Net的PostSharp诊断工具包以及所有依赖项解决了这个问题。