NUNIT 2.5.9 Problema
-
28-10-2019 - |
Domanda
Buongiorno, pomeriggio o notte,
Sto cercando di utilizzare NUNIT 2.5.9 per eseguire alcuni test unitari contenuti in un assembly costruito con Visual Studio 2010 che si rivolge a .NET 2.0. Tuttavia, continuo a ottenere un System.BadImageFormatException
Eccezione ogni volta ... ho provato le soluzioni da soluzioni descritte qui, ma senza risultati. Ho anche scaricato il codice sorgente e lo ho compilato in Visual Studio 2010 Targeting .NET 2.0, ma l'eccezione continua a spuntare ... Cosa non va qui?
System.BadImageFormatException...
Server stack trace:
em System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
em System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
em System.Reflection.Assembly.Load(AssemblyName assemblyRef)
em NUnit.Core.Builders.TestAssemblyBuilder.Load(String path)
em NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
em NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
em NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
em NUnit.Core.SimpleTestRunner.Load(TestPackage package)
em NUnit.Core.ProxyTestRunner.Load(TestPackage package)
em NUnit.Core.ProxyTestRunner.Load(TestPackage package)
em NUnit.Core.RemoteTestRunner.Load(TestPackage package)
em System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
em System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
em System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
em System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
em NUnit.Core.TestRunner.Load(TestPackage package)
em NUnit.Util.TestDomain.Load(TestPackage package)
em NUnit.Util.TestLoader.LoadTest(String testName)
Grazie mille.
Soluzione
Ho visto errori simili che cercavano di testare gli assembly X86 su un sistema a 64 bit.
Potrebbe essere necessario eseguire nunit-x86.exe anziché nunit.exe.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow