문제

I have a small solution with an WPF GUI project, some business logic in library projects and test projects using MbUnit/ Gallio. Everything worked fine so far.

After I added PostSharp Diagnostics Toolkit for Log4Net in it's current version 2.1.6.4 via NuGet to my GUI and library projects I'm not able to run the tests in one of my two test assemblies. I always get a TypeLoadException whithout telling me what type couldn't be loaded. No differece to use Gallio Echo, Gallio Icarus or the Visual Studio test runner.

So I played around a bit and added PostSharp-Diagnostics-Toolkit-Log4Net to the test project, too. Now I get a PostSharp-has-crashed-message-box when I try to run the test and I can view the error details. The following interesting part is telling me in German that the type PostSharp.Toolkit.Diagnostics.LogLevelcould not be loaded. But I have no idea how to fix this.

Although my other test project still works fine and both test projects (of course) don't contain complex things. The project that fails to run has a reference to agsXMPP that is only used to assert that some properties on the xmpp connection object are set. I already tried to remove this reference as well as these asserts but all tests in this project still fail with the TypeLoadException.

Ideas anybody?

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 #path: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 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, StructuredDeclarationDictionary1 _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 phase) bei PostSharp.Sdk.Extensibility.Project.Execute() bei PostSharp.Hosting.PostSharpObject.ExecuteProjects() bei PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation)

도움이 되었습니까?

해결책

I still don't have an idea what was wrong but uninstalling and reinstalling PostSharp Diagnostics Toolkit for Log4Net with all dependencies via NuGet package manager in Visual Studio fixed the problem.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top