0

After installation the software has below structure:

Base installation directory path is : C:/ProgramFiles/APP_Name/App_Base_Dir

Exe Path: C:/ProgramFiles/APP_Name/App_Base_Dir/2ndAppFolder/bin/2ndApp.exe

While trying to run the 2ndApp.exe it is dependent on dlls which are present in the base directory path. How I can refer those dlls in 2ndApp.exe.config file.

I have tried to use AssemblyProbing but it seems to be not working in this case.

Please suggest some other options or correct me in AssemblyProbing.

I have tried adding AssemblyProbing tag in config file.

`<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">  
     <probing privatePath="App_Base_Dir"/>  
   </assemblyBinding>

`

  • I don't know is your probing could solve the problem, but I'd change it with `` because DLLs are thw folders up in the tree. Anyway I'd try to use solution provided in https://stackoverflow.com/questions/5260404/resolve-assembly-references-from-another-folder – Marco Aug 07 '23 at 11:26

1 Answers1

-1

If you are referencing dlls from another assembly, you just can use de following approach in the .csproj file:

    <ItemGroup>
    <Reference Include="dllExported" >
      <HintPath>../../dllExportedTest</HintPath>
      <SpecificVersion>False</SpecificVersion>
    </Reference>
  </ItemGroup>

But if that you need is to reference another project in another folder, you can use this:

  <ItemGroup>
    <ProjectReference Include="..\..\AnotherProject\AnotherProject.csproj" />
  </ItemGroup>