DLL that depends on EPPlus. Can I update it?

Hi, I have an Aras method that calls a function in a custom DLL that I have developed. The DLL depends on EPPlus. I tried to update it from 4.1.1.0 to 4.5.3.2. However, now I'm getting the following error:

Line number -35, Error Number: CS1705, Assembly 'Bajskorv.Aras.Prutt, Version=1.0.7208.28341, Culture=neutral, PublicKeyToken=null' uses 'EPPlus, Version=4.5.3.2, Culture=neutral, PublicKeyToken=ea159fdaa78159a1' which has a higher version than referenced assembly 'EPPlus, Version=4.1.1.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1'

Why does this happen_ Can I not update the dependency_ How do I debug this and fix it_

Parents
  • Hello,

    I believe this is happening because your custom DLL is still referencing the 4.1.1.0 version of the EPPlus DLL specifically. There are two primary ways to handle this.

    The first if you have access to the source code of the custom DLL is to simply update the reference in the project to point to the same version of the EPPlus DLL that you're currently using, in this case 4.5.3.2.

    The second approach is typically only used when you don't have access to the source code of the custom DLL. Inside of the web.config file, you can add a binding redirect that basically says "whenever a library tries to access x version of this DLL, point it to y version instead." Assuming that these DLLs are in your /Server/bin/ folder, you will need to add a redirect to the /Server/web.config in the <runtime/> tag.

        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="EPPlus" publicKeyToken="ea159fdaa78159a1" culture="neutral" />
            <bindingRedirect oldVersion="4.1.1.0" newVersion="4.5.3.2" />
          </dependentAssembly>
        </assemblyBinding>

    Chris

    Christopher GIllis

    Aras Labs Software Engineer

Reply
  • Hello,

    I believe this is happening because your custom DLL is still referencing the 4.1.1.0 version of the EPPlus DLL specifically. There are two primary ways to handle this.

    The first if you have access to the source code of the custom DLL is to simply update the reference in the project to point to the same version of the EPPlus DLL that you're currently using, in this case 4.5.3.2.

    The second approach is typically only used when you don't have access to the source code of the custom DLL. Inside of the web.config file, you can add a binding redirect that basically says "whenever a library tries to access x version of this DLL, point it to y version instead." Assuming that these DLLs are in your /Server/bin/ folder, you will need to add a redirect to the /Server/web.config in the <runtime/> tag.

        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="EPPlus" publicKeyToken="ea159fdaa78159a1" culture="neutral" />
            <bindingRedirect oldVersion="4.1.1.0" newVersion="4.5.3.2" />
          </dependentAssembly>
        </assemblyBinding>

    Chris

    Christopher GIllis

    Aras Labs Software Engineer

Children
No Data