I have a C# class library MyLibrary in which I am referencing a sample.dll version 2.7.0. This MyLibrary is being referenced in WCF project. Which is deployed on the server.
Now on the server, I have sample.dll with the version 3.0.0 because of that I am getting referenced dll not found error as following.
Could not load file or assembly 'sample, Version=184.108.40.206, Culture=neutral, PublicKeyToken=185805eaf7302b6c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have found few solutions for making it version Independent like adding 'BindingRedirect' as it is a class library, I don't have web.config or app.config where I can configure 'BindingRedirect'. I have also tried setting 'Specific Version' to false but still getting the same error.
I want to make my class library such that it should work with any version of Sample dll
I tried adding following in web.config of my WCF project
<dependentAssembly> <assemblyIdentity name="sample" publicKeyToken="185805eaf7302b6c" culture="neutral"/> <bindingRedirect oldVersion="220.127.116.11" newVersion="18.104.22.168"/> </dependentAssembly>
But still getting the same error.
User contributions licensed under CC BY-SA 3.0