简体   繁体   English

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

[英]Yet another “could not load file or assembly … or one of its dependencies. The system cannot find the file specified”

I have a dll with NUnit tests that had been working fine. 我有一个运行良好的NUnit测试的dll。 I converted it from an Any CPU to an x86 project because I need to use SQLite reliably across different platforms, so I need to include the 32-bit System.Data.SQLite.dll and let everything reference that. 我将它从Any CPU转换为x86项目,因为我需要在不同平台上可靠地使用SQLite,所以我需要包含32位System.Data.SQLite.dll并让所有内容引用它。

Anyway, after conversion, NUnit gives that error when trying to load the dll. 无论如何,转换后,NUnit在尝试加载dll时会出错。

I don't think this will be enlightening at all, but here is the stack trace: 我认为这根本不具有启发性,但这里是堆栈跟踪:

System.IO.FileNotFoundException: Could not load file or assembly ... or one of its dependencies. The system cannot find the file specified"

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)

The dll I'm trying to test references another one in the same solution. 我试图测试的DLL在同一个解决方案中引用了另一个。 Everything works fine when I run the GUI that this eventually all gets used in, but the tests won't load. 当我运行最终全部使用的GUI时,一切正常,但测试不会加载。

Update 更新

The file that can't be loaded is the assembly under test, which is just MyAppName.Test.dll. 无法加载的文件是被测试的程序集,它只是MyAppName.Test.dll。

Try using the fusion log viewer fuslogvw.exe . 尝试使用fusion log viewer fuslogvw.exe It should give you more details about the problem. 它应该为您提供有关该问题的更多详细信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 具体:无法加载文件或程序集“xxxx”或其依赖项之一。 该系统找不到指定的文件 - A specific: Could not load file or assembly 'xxxx' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“coba4”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'coba4' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“ skmMenu”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'skmMenu' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集或其依赖项之一。 该系统找不到指定的文件。 (不允许GAC) - Could not load file or assembly or one of its dependencies. The system cannot find the file specified. (No GAC allowed) 无法加载文件或程序集“System.Net.Http.Formatting”或其依赖项之一。 该系统找不到指定的路径 - Could not load file or assembly 'System.Net.Http.Formatting' or one of its dependencies. The system cannot find the path specified 无法加载文件或程序集“ Microsoft.Data.Service”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Microsoft.Data.Service' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“Microsoft.AspNet.TelemetryCorrelation”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Microsoft.AspNet.TelemetryCorrelation' or one of its dependencies. The system cannot find the file specified SQL Server 自定义 CLR 失败并显示错误“无法加载文件或程序集或其依赖项之一。系统找不到指定的文件。” - SQL Server custom CLR fails with error "Could not load file or assembly or one of its dependencies. The system cannot find the file specified." 生产中的Azure SDK 2.2:无法加载文件或程序集“msshrtmi”或其依赖项之一。 该系统找不到指定的文件 - Azure SDK 2.2 in Production: Could not load file or assembly 'msshrtmi' or one of its dependencies. The system cannot find the file specified “‘无法加载文件或程序集‘Elmah’或其依赖项之一。在 NuGet 中使用 Elmah.MVC 后,系统找不到指定的文件” - "'Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified'' after using Elmah.MVC in NuGet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM