Skip to content

Wrong dependency version resolution #506

Closed

Description

@vasily-kirichenko

paket.dependencies:

source https://www.nuget.org/api/v2

nuget HtmlAgilityPack
nuget Fizzler.Systems.HtmlAgilityPack

paket.references:

HtmlAgilityPack
Fizzler.Systems.HtmlAgilityPack

paket.lock:

NUGET
  remote: https://www.nuget.org/api/v2
  specs:
    Fizzler (1.0.0) - >= net20, >= net35
      LinqBridge (>= 1.3.0) - >= net20 < net35
    Fizzler.Systems.HtmlAgilityPack (1.0.0)
      Fizzler (>= 1.0.0) - >= net20, >= net35
      HtmlAgilityPack (>= 1.4.6) - >= net20, >= net35
      LinqBridge (>= 1.3.0) - >= net20 < net35
    HtmlAgilityPack (1.4.9) - >= net20, >= net35
    LinqBridge (1.3.0) - >= net20 < net35

Dependencies in dotPeek:

image

An attempt to run the console:

image

Activity

  1. forki commented on Jan 2, 2015

    @forki
    Member

    Just tried your repro. It looks perfectly fine on my machine.

    I assume it has to do with the "fixed" unzip of the HtmlAgilityPack package. Maybe the old dll was still there and got referenced.

  2. kerams commented on Jan 2, 2015

    @kerams
    Contributor

    Looks to me like a binding redirect issue. Give paket install --redirects a shot (and make sure there are app.config files for the command to write the redirects to).

  3. vasily-kirichenko commented on Jan 2, 2015

    @vasily-kirichenko
    ContributorAuthor

    The project did not contain app.config. I added it, paket install --redirects modified it as follows:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Fizzler" publicKeyToken="4ebff4844e382110" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-0.1.15619.0" newVersion="0.1.15619.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="LinqBridge" publicKeyToken="c2b14eb747628076" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>

    But the error as before.

  4. vasily-kirichenko commented on Jan 2, 2015

    @vasily-kirichenko
    ContributorAuthor

    @forki try to run PaketTest console.

  5. vasily-kirichenko commented on Jan 2, 2015

    @vasily-kirichenko
    ContributorAuthor

    If I manually add

    <dependentAssembly>
            <assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-1.4.9.0" newVersion="1.4.9.0" />
    </dependentAssembly>

    the error is gone.

  6. kerams commented on Jan 2, 2015

    @kerams
    Contributor

    @vasily-kirichenko I was about to suggest that :))).
    Guess it means that --redirects fails to detect it.

  7. isaacabraham commented on Jan 2, 2015

    @isaacabraham
    Contributor

    Hmmm. Is HtmlAgilityPack strong named?

  8. isaacabraham commented on Jan 2, 2015

    @isaacabraham
    Contributor

    sure, will do.

  9. isaacabraham commented on Jan 2, 2015

    @isaacabraham
    Contributor

    @vasily-kirichenko Just trying your test project - interestingly when I try a paket restore I get:

    Bad Crc during unzipping lib/sl3-wp/_._ in HtmlAgilityPack 1.4.9: CRC error: the file being extracted appears to be corrupted. Expected 0x00000000, Actual 0x6AF4413C
    
  10. vasily-kirichenko commented on Jan 2, 2015

    @vasily-kirichenko
    ContributorAuthor

    That's known issue with this package.

  11. vasily-kirichenko commented on Jan 2, 2015

    @vasily-kirichenko
    ContributorAuthor

    @forki maybe this causes the problem with missing redirect?

  12. isaacabraham commented on Jan 2, 2015

    @isaacabraham
    Contributor

    The redirect is missed because the assembly doesn't appear to be strong named.

  13. forki commented on Jan 2, 2015

    @forki
    Member

    Isaac, that crc error should be ignored in latest paket.
    On Jan 2, 2015 7:01 PM, "Isaac Abraham" [email protected] wrote:

    The redirect is missed because the assembly doesn't appear to be strong
    named.

    —
    Reply to this email directly or view it on GitHub
    #506 (comment).

  14. isaacabraham commented on Jan 2, 2015

    @isaacabraham
    Contributor

    OK, found it. It's because only some of the libs in the package are strong named. The current algorithm in applyBindingRedirects just takes the last assembly with the highest version. I'm rewriting this to take into account that only some assemblies in a package may be strong named.

  15. added a commit that references this issue on Jan 2, 2015
    acabe40
  16. vasily-kirichenko commented on Jan 2, 2015

    @vasily-kirichenko
    ContributorAuthor

    Any chance to publish the fixed version?

  17. isaacabraham commented on Jan 2, 2015

    @isaacabraham
    Contributor

    Submitted a PR - please test it out. I tested it against your test project and HtmlAgilityPack is then added: -

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Fizzler" publicKeyToken="4ebff4844e382110" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-0.1.15619.0" newVersion="0.1.15619.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="LinqBridge" publicKeyToken="c2b14eb747628076" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-1.4.9.0" newVersion="1.4.9.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>
  18. added a commit that references this issue on Jan 2, 2015
    8a7b4a7
  19. forki commented on Jan 2, 2015

    @forki
    Member

    Released. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions