首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FitSharp无法在其他文件夹中找到.DLLs

FitSharp无法在其他文件夹中找到.DLLs
EN

Stack Overflow用户
提问于 2019-04-12 12:11:16
回答 1查看 215关注 0票数 1

我让System.IO.FileNotFoundException试着测试我的应用程序。我的文件夹层次结构如下:

  • 我的fitSharp文件夹中有Runner.exe和..dll
  • 正在测试的系统在我的调试文件夹中。
  • 我有一个关于这个.dll的引用:!path ........\Debug\XXXXX.dll

所以问题是,由于我使用的是依赖注入,所以fitSharp无法找到统一所需的.dll。我总是得到FileNotFound异常。

问题是,如果我将所有文件(.dll)复制到fitSharp文件夹( Runner.exe所在的地方),测试就会正常工作。

问题是,fitSharp无法在不同的文件夹中找到文件,而且我不知道如何提供到fitsharp的这个路径。

我已经尝试使用一个configuration.xml文件来声明所有需要的DLL,但仍然没有。

代码语言:javascript
复制
__ EXCEPTION __:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> XXXException: Verbindung fehlgeschlagen. DatabaseException (0x80004005): Failed to execute non query ---> System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for unity: Could not load file or assembly 'Microsoft.Practices.Unity.Configuration' or one of its dependencies. Das System kann die angegebene Datei nicht finden. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.Unity.Configuration' or one of its dependencies. Das System kann die angegebene Datei nicht finden. at System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalConfigHost host, String typeString, Boolean throwOnError) at System.Configuration.MgmtConfigurationRecord.CreateSectionFactory(FactoryRecord factoryRecord) at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere) at fitSharp.Machine.Model.TypedValue.ThrowExceptionIfNotValid() at fitSharp.Slim.Operators.InvokeInstructionBase.InvokeMember(Tree1 parameters, Int32 memberIndex)
at fitSharp.Slim.Operators.ExecuteCall.ExecuteOperation(Tree1 parameters) at fitSharp.Slim.Operators.InvokeInstructionBase.Invoke(TypedValue instance, MemberName memberName, Tree`1 parameters)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-04-25 15:32:19

您可以尝试显式加载缺少的DLL:

代码语言:javascript
复制
!path pathToDll\Microsoft.Practices.Unity.Configuration.dll

或者在套件配置文件中尝试这个条目:

代码语言:javascript
复制
<suiteConfig>
    <System.AppDomainSetup>
        <ApplicationBase>pathToSUT</ApplicationBase>
        ...
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55651339

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档