Cannot configure Remoting service to load assembly from child folder

0

I'm trying to configure a remoting service (.net Framework 2.0) to load an specific assembly. Currently we have EPPlus.dll (v2.8.0.2) in the main folder where the service runs (this folder is shared by many other services), but my service needs to load EPPlus.dll (v4.0.4.0) that is stored in a subfolder. Both have the same name. I've been editing App.config with no luck. Here's my last attempt:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="EPPlus" culture="neutral" publicKeyToken="ea159fdaa78159a1" />
    <!--<publisherPolicy apply="no"/>-->
    <codebase version="4.0.4.0" href="C:\Program Files\MyCompany\Services\Common\EPPlus.dll" />
    <codebase version="2.8.0.2" href="C:\Program Files\MyCompany\Services\EPPlus.dll" />
  </dependentAssembly>
</assemblyBinding>

I've enabled server logging:

LOG: User = NT AUTHORITY\SYSTEM LOG: DisplayName = EPPlus, Version=4.0.4.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1 (Fully-specified) LOG: Appbase = file:///C:/Program Files/MyCompany/Services/ LOG: Initial PrivatePath = NULL

Calling assembly : MyCompany.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.

LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Program Files\MyCompany\Services\MyService.Remoting.exe.Config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config. LOG: Post-policy reference: EPPlus, Version=4.0.4.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1 LOG: Attempting download of new URL file:///C:/Program Files/MyCompany/Services/EPPlus.DLL. WRN: Comparing the assembly name resulted in the mismatch: Major Version ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Thanks in advance for your answers.

c#
.net
service
.net-remoting
asked on Stack Overflow Jun 6, 2018 by nowayout

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0