.net - Fitnesse problems loading dll -


i having trouble loading that.dll contains test classes call work.dll.

i can nicely helloworld.dll when put helloworld test in test.dll, cannot load, after remove work.dll references test.dll

i think problem path work.dll not known fitness, how specify it? ( preferebly in root page)

the error messages are:

system.badimageformatexception: not load file or assembly 'file:///c:\projects\..\test.dll' or 1 of dependencies. attempt made load program incorrect format. file name: 'file:///c:\projects\..\test.dll'    @ system.reflection.runtimeassembly._nload(assemblyname filename, string codebase, evidence assemblysecurity, runtimeassembly locationhint, stackcrawlmark& stackmark, intptr pprivhostbinder, boolean throwonfilenotfound, boolean forintrospection, boolean suppresssecuritychecks)    @ system.reflection.runtimeassembly.internalloadassemblyname(assemblyname assemblyref, evidence assemblysecurity, runtimeassembly reqassembly, stackcrawlmark& stackmark, intptr pprivhostbinder, boolean throwonfilenotfound, boolean forintrospection, boolean suppresssecuritychecks)    @ system.reflection.runtimeassembly.internalloadassemblyname(assemblyname assemblyref, evidence assemblysecurity, runtimeassembly reqassembly, stackcrawlmark& stackmark, boolean throwonfilenotfound, boolean forintrospection, boolean suppresssecuritychecks)    @ system.reflection.runtimeassembly.internalloadfrom(string assemblyfile, evidence securityevidence, byte[] hashvalue, assemblyhashalgorithm hashalgorithm, boolean forintrospection, boolean suppresssecuritychecks, stackcrawlmark& stackmark)    @ system.reflection.assembly.loadfrom(string assemblyfile)    @ fitsharp.machine.engine.currentdomain.loadassembly(string assemblypath)    @ fitsharp.machine.engine.applicationundertest.assemblies.addassembly(string assemblyname)    @ fitsharp.machine.engine.applicationundertest.addassemblies(ienumerable`1 assemblynames)    @ fitnesse.fitserver.fitserver.parsecommandlinearguments(ienumerable`1 args)    @ fitnesse.fitserver.fitserver.run(ilist`1 commandlinearguments)    @ fitnesse.fitserver.fitserver.run(ilist`1 commandlinearguments, memory memory, progressreporter reporter)    @ fitsharp.machine.application.shell.run()    @ fitsharp.machine.application.shell.execute()    @ fitsharp.machine.application.shell.run(ilist`1 commandlinearguments)  === pre-bind state information === log: user = kenneth log: where-ref bind. location = c:\projects\..\test.dll log: appbase = file:///c:/projects/fitnesse/dotnet2/ log: initial privatepath = null calling assembly : (unknown). === log: bind starts in loadfrom load context. wrn: native image not probed in loadfrom context. native image probed in default load context, assembly.load(). log: using application configuration file: c:\projects\fitnesse\dotnet2\runner.exe.config log: using host configuration file:  log: using machine configuration file c:\windows\microsoft.net\framework64\v4.0.30319\config\machine.config. log: attempting download of new url file:///c:/projects/../test.dll. err: failed complete setup of assembly (hr = 0x8007000b). probing terminated. 

does have clues/tips.

thanks kenneth

you can load dlls match bitness of application's process. that's badimageformatexception trying tell you, you've attempted load incompatible dll.

so if have 32-bit (x86) process, can load 32-bit (x86) dlls.
, if have 64-bit (x64) process, can load 64-bit (x64) dlls.

the "any cpu" compiler setting means bitness of process match native bitness of machine: 64-bit on 64-bit os, 32-bit otherwise.

you need either obtain version of dll matches bitness of application, or re-compile application target different bitness.


Comments