簡體   English   中英

FitSharp 無法在其他文件夾中找到 .DLL

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

我在嘗試測試我的應用程序時遇到 System.IO.FileNotFoundException。 我的文件夾層次結構如下:

  • 我有我的 fitSharp 文件夾,里面有 Runner.exe 和 .dll 的
  • 被測系統在我的調試文件夾中
  • 我有一個對這個 .dll 的引用: !path ........\\Debug\\XXXXX.dll

所以問題是,當我使用依賴注入 fitSharp 無法找到統一所需的 .dll 時。 我一直收到 FileNotFound 異常。

問題是,如果我將所有文件 (.dll) 復制到 Runner.exe 所在的 fitSharp 文件夾中,則測試工作正常。

問題是,fitsharp 無法在不同的文件夾中找到文件,我不知道如何為 fitSharp 提供此路徑。

我已經嘗試使用 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)

您可以嘗試顯式加載丟失的 DLL:

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

或在套件配置文件中嘗試此條目:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM