NUnit与探测路径

NUnit与探测路径,nunit,Nunit,注意:此处的所有程序集都不是强名称的 我正在使用NUnit试用2.4.2和2.5.2在程序集A中运行测试。程序集A引用程序集B v2。程序集A还引用程序集C,而程序集C又引用程序集B v1 当我从只包含程序集B v2的bin\Debug目录运行程序集A时,测试失败,并显示一条消息,说明如何找不到程序集B v1 我试图通过创建assemblyA.dll.config文件来解决这个问题。在该文件中,我指定了一个绑定重定向,尽管我知道它们不适用于非强名称程序集,并指定了一个探测路径,该路径应允许NUn

注意:此处的所有程序集都不是强名称的

我正在使用NUnit试用2.4.2和2.5.2在程序集A中运行测试。程序集A引用程序集B v2。程序集A还引用程序集C,而程序集C又引用程序集B v1

当我从只包含程序集B v2的bin\Debug目录运行程序集A时,测试失败,并显示一条消息,说明如何找不到程序集B v1

我试图通过创建assemblyA.dll.config文件来解决这个问题。在该文件中,我指定了一个绑定重定向,尽管我知道它们不适用于非强名称程序集,并指定了一个探测路径,该路径应允许NUnit仅使用程序集B v2

不幸的是,我总是犯同样的错误

我还尝试使用FusionLogViewer检查绑定过程

Assembly Binder Log Entry  (8/19/2009 @ 4:54:38 PM) ***

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from:  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  D:\svncheckout\gl\ext\win32\sourceforge\nunit-net20\2.5.2\nunit.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = ????
LOG: DisplayName = assemblyB, Version=1.0.3511.15236, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = .../bin/Debug
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = Tests_1523525484
Calling assembly : assemblyC, Version=1.0.0.64031, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file:...\bin\Debug\assemblyA.dll.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Binding succeeds. Returns assembly from ...\bin\Debug\assemblyB.dll. (this is v2)
LOG: Assembly is loaded in default load context.

有什么想法吗?

作为补充,我有以下问题:我认为在处理非强名称程序集时,CLR加载并使用任何可用版本。看这个。如果这是真的,为什么NUnit一开始就抱怨找不到程序集B v1?这是否与NUnit创建一个单独的AppDomain来运行测试有关