我有問題加載that.dll包含我的測試類,調用到我的work.dll。Fitnesse問題加載DLL
我可以用helloworld.dll很好地做到這一點,但是當我把HelloWorld的測試中我Test.dll的,它不能加載,即使我從Test.dll的
刪除我work.dll引用認爲她的問題是通過Fitness不知道work.dll的路徑,我該如何指定它? (preferebly根頁)
錯誤消息我得到的是:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Projects\..\test.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'file:///C:\Projects\..\test.dll'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at fitSharp.Machine.Engine.CurrentDomain.LoadAssembly(String assemblyPath)
at fitSharp.Machine.Engine.ApplicationUnderTest.Assemblies.AddAssembly(String assemblyName)
at fitSharp.Machine.Engine.ApplicationUnderTest.AddAssemblies(IEnumerable`1 assemblyNames)
at fitnesse.fitserver.FitServer.ParseCommandLineArguments(IEnumerable`1 args)
at fitnesse.fitserver.FitServer.Run(IList`1 CommandLineArguments)
at fitnesse.fitserver.FitServer.Run(IList`1 commandLineArguments, Memory memory, ProgressReporter reporter)
at fitSharp.Machine.Application.Shell.Run()
at fitSharp.Machine.Application.Shell.Execute()
at 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: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Projects\fitnesse\dotnet2\Runner.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Attempting download of new URL file:///C:/Projects/../test.dll.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
沒有人有任何線索/提示。
感謝 肯尼斯
我已經進一步調查了,問題似乎取決於我正在編譯的目標平臺的類型。當我做一個虛擬測試並編譯到AnyCPU時,它看起來很好地工作。但是,當我鏈接到work.dll - 編譯爲x86時,它不再加載。 (由於86/64問題,我得到了一個MSIL警告)關於如何解決這個問題的任何想法(除了將引用的項目編譯爲64位 - 我在64位win 7上運行)? – kfn