简体   繁体   English

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

[英]FitSharp is not able to find .DLLs in other folders

I'm getting System.IO.FileNotFoundException trying to test my application.我在尝试测试我的应用程序时遇到 System.IO.FileNotFoundException。 My Folder hierarchy is as follow:我的文件夹层次结构如下:

  • I have my fitSharp folder with the Runner.exe and the .dll's我有我的 fitSharp 文件夹,里面有 Runner.exe 和 .dll 的
  • The system under test is in my debug folder被测系统在我的调试文件夹中
  • i have a reference to this .dll with: !path ........\\Debug\\XXXXX.dll我有一个对这个 .dll 的引用: !path ........\\Debug\\XXXXX.dll

So the problem is, as I'm using Dependecy Injection fitSharp is not able to find the required .dll for unity.所以问题是,当我使用依赖注入 fitSharp 无法找到统一所需的 .dll 时。 I'm getting FileNotFound Exception all the time.我一直收到 FileNotFound 异常。

The thing is if i copy all the files (.dll) to my fitSharp folder where the Runner.exe is, the test is working fine.问题是,如果我将所有文件 (.dll) 复制到 Runner.exe 所在的 fitSharp 文件夹中,则测试工作正常。

The problem is, fitsharp is not able to find files in a different folder and i have no idea how to provide this path to fitSharp.问题是,fitsharp 无法在不同的文件夹中找到文件,我不知道如何为 fitSharp 提供此路径。

I tried already to use a configuration.xml file to declare all the needed DLLs but still no.我已经尝试使用 configuration.xml 文件来声明所有需要的 DLL,但仍然没有。

__ 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)

You can try explicitly loading the missing DLL:您可以尝试显式加载丢失的 DLL:

!path pathToDll\Microsoft.Practices.Unity.Configuration.dll

or try this entry in the suite configuration file:或在套件配置文件中尝试此条目:

<suiteConfig>
    <System.AppDomainSetup>
        <ApplicationBase>pathToSUT</ApplicationBase>
        ...

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM