gpt4 book ai didi

visual-studio-2010 - NUnit 2.5.9 问题

转载 作者:行者123 更新时间:2023-12-04 06:31:05 27 4
gpt4 key购买 nike

早上好,下午好,晚上好,

我正在尝试使用 NUnit 2.5.9 来运行一些包含在使用 Visual Studio 2010 构建的程序集中的单元测试,该程序集中针对 .NET 2.0。但是,我不断收到 System.BadImageFormatException每次都异常(exception)...我尝试了描述的解决方法 here ,但无济于事。我也下载了源代码并在面向.NET 2.0 的Visual Studio 2010 下编译它,但异常不断弹出......这里出了什么问题?

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)

非常感谢。

最佳答案

我在 64 位系统上尝试测试 x86 程序集时看到过类似的错误。

您可能需要运行 nunit-x86.exe 而不是 nunit.exe。

关于visual-studio-2010 - NUnit 2.5.9 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5403837/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com