← Back to team overview

nunit-core team mailing list archive

Re: [Bug 566907] Re: System.IO.FileNotFoundException when Platform target is not Any CPU

 

Thanks... I'm working on a fix and I'll use this to verify it.

The problem is that NUnit's AssemblyReader class assumes PE32 format, while x64
binaries use PE32+ format. There are a few differences in the offsets and some
data element sizes.

This has gone unnoticed while AssermblyReader was only used to check for version
information after a failure to load and also in the Tools | Test
Assemblies... display
of the gui. But with 2.5.4, it is used for every assembly loaded
unless you select the
framework explicitly in the nunit project, through the gui or via the
command line.

Combined with our .NET 4.0 problem, this can make 2.5.4 unusable for
some people.

Best workaround I know is to create shortcuts that force NUnit to run under the
specific CLR you will use for testing and _also_ specify the framework to use.
Or use 2.5.3 for now. I'll release 2.5.5 as soon as this bug is fixed.

Charlie

On Tue, Apr 20, 2010 at 9:43 AM, Robert Dzikowski <rdzikowski@xxxxxxxxx> wrote:
> Here you are x64 assembly, requires .Net 3.5
>
> ** Attachment added: "NunitBug.exe"
>   http://launchpadlibrarian.net/44908176/NunitBug.exe
>
> --
> System.IO.FileNotFoundException when Platform target is not Any CPU
> https://bugs.launchpad.net/bugs/566907
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
>

-- 
System.IO.FileNotFoundException when Platform target is not Any CPU
https://bugs.launchpad.net/bugs/566907
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.

Status in NUnit V2 Test Framework: New

Bug description:
I am using Windows 7 64 bit, Visual Studio 2010, GUI runner, NUnit 2.5.4.10098.

When I compile any program with Build option Platform target set not to Any CPU 
(Platform target is not Any CPU) then I get this exception:

System.IO.FileNotFoundException...

Server stack trace: 
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at NUnit.Core.Builders.TestAssemblyBuilder.Load(String path)
   at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
   at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
   at NUnit.Core.TestSuiteBuilder.BuildSingleAssembly(TestPackage package)
   at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
   at NUnit.Core.SimpleTestRunner.Load(TestPackage package)
   at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
   at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
   at NUnit.Core.RemoteTestRunner.Load(TestPackage package)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at NUnit.Core.TestRunner.Load(TestPackage package)
   at NUnit.Util.TestDomain.Load(TestPackage package)
   at NUnit.Util.TestLoader.LoadTest(String testName)





References