又一个“无法加载文件或程序集...或其某个依赖项。系统找不到指定的文件”

7
我有一个带有NUnit测试的dll,一直工作得很好。我将其从Any CPU转换为x86项目,因为我需要在不同平台上可靠地使用SQLite,所以我需要包含32位System.Data.SQLite.dll并让所有内容引用它。
无论如何,在转换后,当尝试加载dll时,NUnit会出现错误。
我认为这不会有任何启发作用,但是以下是堆栈跟踪:
System.IO.FileNotFoundException:无法加载文件或程序集...或其一个依赖项。系统找不到指定的文件"
服务器堆栈跟踪: 在System.Reflection.Assembly._nLoad(AssemblyName fileName,String codeBase,Evidence assemblySecurity,Assembly locationHint,StackCrawlMark& stackMark,Boolean throwOnFileNotFound,Boolean forIntrospection) 在System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,Evidence assemblySecurity,StackCrawlMark& stackMark,Boolean forIntrospection) 在System.Reflection.Assembly.InternalLoad(String assemblyString,Evidence assemblySecurity,StackCrawlMark& stackMark,Boolean forIntrospection) 在System.Reflection.Assembly.Load(String assemblyString) 在NUnit.Core.Builders.TestAssemblyBuilder.Load(String path) 在NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName,Boolean autoSuites) 在NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName,String testName,Boolean autoSuites) 在NUnit.Core.TestSuiteBuilder.BuildSingleAssembly(TestPackage package) 在NUnit.Core.TestSuiteBuilder.Build(TestPackage package) 在NUnit.Core.SimpleTestRunner.Load(TestPackage package) 在NUnit.Core.ProxyTestRunner.Load(TestPackage package) 在NUnit.Core.ProxyTestRunner.Load(TestPackage package) 在NUnit.Core.RemoteTestRunner.Load(TestPackage package) 在System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md,Object[] args,Object server,Int32 methodPtr,Boolean fExecuteInContext,Object[]& outArgs) 在System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg,Int32 methodPtr,Boolean fExecuteInContext)
异常重新抛出为[0]: 在System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg) 在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,Int32 type) 在NUnit.Core.TestRunner.Load(TestPackage package) 在NUnit.Util.TestDomain.Load(TestPackage package) 在NUnit.Util.TestLoader.LoadTest(String testName)
我正在尝试测试的dll引用了同一解决方案中的另一个dll。当我运行最终使用所有内容的GUI时,一切都很正常,但是测试无法加载。
更新:
无法加载的文件是要测试的程序集,即MyAppName.Test.dll。

我可以知道哪些文件无法加载吗? NUnit.Framework.dll?还是其他的什么? - Graviton
请参见更新。 (糟糕,我们不能再使用空格来达到字符限制了。) - Instance Hunter
NUnit的引用是否命中全局程序集缓存(GAC),还是将nunit.framework.dll本地复制? - Mike Two
2
你尝试使用融合日志查看器(fuslogvw.exe)获取更多详细信息了吗?http://msdn.microsoft.com/en-us/library/e74a18c4(VS.71).aspx - Mike Two
NUnit已被本地复制。 - Instance Hunter
请在答案中发布Fusion Log Viewer链接,以便我可以标记它。我用它找到了问题。谢谢。 - Instance Hunter
1个回答

6

尝试使用融合日志查看器fuslogvw.exe。它应该能够提供有关问题的更多详细信息。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接