5

In my project I have to use different versions of AWSSDK dll's, in order to make this i took help of this post . and added one of my dll in to a folder named V-1 inside bin folder. Then made config changes like this

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>        
        <assemblyIdentity name="AWSSDK" publicKeyToken="CD2D24CD2BACE800" culture="neutral" />
            <codeBase version="1.4.8.2" href="V-1\AWSSDK.dll" />
            <codeBase version="2.3.40.0" href="AWSSDK.dll" />
        </dependentAssembly>      
    </assemblyBinding>
</runtime>

But I still gets the error like this

Error 2 Could not load file or assembly 'AWSSDK, Version=1.4.8.2, Culture=neutral, PublicKeyToken=cd2d24cd2bace800' or one of its dependencies. The system cannot find the file specified. E:\Live \Web.config 129

At this line in web-Config

 <add assembly="AWSSDK, Version=1.4.8.2,  Culture=neutral, PublicKeyToken=CD2D24CD2BACE800" />

Can anyone please point-out what I am doing wrong??

Community
  • 1
  • 1
None
  • 5,582
  • 21
  • 85
  • 170
  • Try altering the path... e.g. so it doesn't have a hyphen, i.e. make it V1 – Paul Zahra Jun 05 '15 at 08:55
  • Are you aware that local paths in `href` are relative to the application directory? Perhaps you meant `bin\V-1\AWSSKDK.dll` etc. instead? – Luaan Jun 05 '15 at 08:57
  • My next point was to say try a fully qualified path... e.g. href="file://c:/some_path/myassembly.dll" – Paul Zahra Jun 05 '15 at 08:58
  • @Luaan Not strictly true dood... "If the assembly is a private assembly, the codebase setting must be a path relative to the application's directory." – Paul Zahra Jun 05 '15 at 08:59
  • @Luaan tried changing path, same error – None Jun 05 '15 at 09:11
  • @PaulZahra tried it all not working – None Jun 05 '15 at 09:12
  • @Athul Make sure that both assemblies are strongly signed and the token is correct for both. i.e. if not strongly signed then versioning is ignored. – Paul Zahra Jun 05 '15 at 09:27
  • @PaulZahra both assemblies are strongly signed. But i can add token for only one here, so skipped second ones token. Can you say how it is done correctly? – None Jun 05 '15 at 09:37
  • Hmm you have a bit of a quandry then... strongly signed = publickeytoken... no public key token means versioning is ignored... hmm I suggest you first remove the second binding to ensure that everything is fine with the rest of your code... if so then add the 2nd binding back and try running https://msdn.microsoft.com/en-us/library/e74a18c4%28v=vs.110%29.aspx to work out exactly whats going on. – Paul Zahra Jun 05 '15 at 09:47

1 Answers1

3
  1. Please open Solution Explorer in visual studio
  2. Open References under the project
  3. Select AWSSdk reference and go to its properties.
  4. Set Specific Version = True and Copy Local = False
  5. Make sure your output directory does not contain this dll in it.
M.S.
  • 4,283
  • 1
  • 19
  • 42
  • Please check if NewtonSoft.Json.dll is not having different versions. I meant this dll must be of the same version. If not, then please do the same for this as well – M.S. Jun 05 '15 at 09:55