Search code examples
asp.net-web-apiodata

OData dll version issue


In Package configuration file, I gave version 7.0.0 for OData dll's.

<package id="Microsoft.OData.Core" version="7.0.0" targetFramework="net461" />
<package id="Microsoft.OData.Edm" version="7.0.0" targetFramework="net461" />

Sometime the bin folder showed me the version 6 of OData dll's, what could be the reason?

enter image description here

Sometime if I delete the bin folder and recompile again, the version is correct, but sometime it's wrong. Please suggest!


Solution

  • If you keep on facing the same problem, you can opt for bindingRedirect to a lower verion as in this StackOverflow Post in your configuration file.

    <configuration>
       <runtime>
          <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
             <dependentAssembly>
                <assemblyIdentity name="Microsoft.OData.Core"
                                  publicKeyToken="31bf3856ad364e35"
                                  culture="neutral" />
                <bindingRedirect oldVersion="7.0.0"
                                 newVersion="6.0.4"/>
             </dependentAssembly>
          </assemblyBinding>
       </runtime>
    </configuration>