question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Paket could not resolve package version even though it exists in available versions

See original GitHub issue

Description

Within our windows installers, we use MahApps.Metro.Resources package

In paket.dependencies, we have

nuget MahApps.Metro.Resources 0.4.0.0 framework: >= net45

but when updating another package (in this case, Fody), paket says that it cannot resolve this version of the package, even though it is listed in the available versions.

.\.paket\paket.exe update nuget Fody version 1.29.4
Paket version 5.0.0-alpha020
Updating Fody to version 1.29.4 in C:\Users\russ\source\windows-installers\paket.dependencies group Main
Resolving packages for group Main:
 - Fody is pinned to 1.29.4
 - reactiveui is pinned to 6.3.1
 - reactiveui-core is pinned to 6.3.1
 - reactiveui-events is pinned to 6.3.1
 - FluentValidation is pinned to 5.5.0.0
 - YamlDotNet is pinned to 3.8.0
 - Topshelf is pinned to 3.1.4
 - ILMerge is pinned to 2.14.1208
 - Rx-Core is pinned to 2.2.5
 - Rx-Interfaces is pinned to 2.2.5
 - Rx-Linq is pinned to 2.2.5
 - Rx-Main is pinned to 2.2.5
 - Rx-PlatformServices is pinned to 2.2.5
 - Rx-XAML is pinned to 2.2.5
 - Splat is pinned to 1.6.0
 - Costura.Fody is pinned to 1.3.3.0
 - WindowsAPICodePack-Core is pinned to 1.1.1
 - WindowsAPICodePack-Shell is pinned to 1.1.1
 - HtmlTextBlock is pinned to 1.0.1
 - MahApps.Metro is pinned to 1.0.1-ALPHA027
 - MahApps.Metro.Resources is pinned to 0.4.0.0
Paket failed with:
        There was a version conflict during package resolution.
  Resolved packages:
   - Costura.Fody 1.3.3.0
   - FluentValidation 5.5.0.0
   - Fody 1.29.4
   - HtmlTextBlock 1.0.1
   - ilmerge 2.14.1208
   - MahApps.Metro 1.0.1-ALPHA027
   - reactiveui 6.3.1
   - reactiveui-core 6.3.1
   - reactiveui-events 6.3.1
   - Rx-Core 2.2.5
   - Rx-Interfaces 2.2.5
   - Rx-Linq 2.2.5
   - Rx-Main 2.2.5
   - Rx-PlatformServices 2.2.5
   - Rx-Xaml 2.2.5
   - Splat 1.6.0
   - Topshelf 3.1.4
   - WindowsAPICodePack-Core 1.1.1
   - WindowsAPICodePack-Shell 1.1.1
   - YamlDotNet 3.8.0
  Could not resolve package MahApps.Metro.Resources 0.4:
   - Available versions:
     - (0.4, [https://api.nuget.org/v3/index.json])
     - (0.6.1, [https://api.nuget.org/v3/index.json])
     - (0.6.0, [https://api.nuget.org/v3/index.json])
     - (0.5.0, [https://api.nuget.org/v3/index.json])
     - (0.4.0, [https://api.nuget.org/v3/index.json])
     - (0.3.0, [https://api.nuget.org/v3/index.json])
     - (0.2.1, [https://api.nuget.org/v3/index.json])
     - (0.2.0, [https://api.nuget.org/v3/index.json])
     - (0.1.0.1, [https://api.nuget.org/v3/index.json])
     - (0.1.0, [https://api.nuget.org/v3/index.json])

  Please try to relax some conditions or resolve the conflict manually (see http://fsprojects.github.io/Paket/nuget-dependencies.html#Use-exactly-this-version-constraint).

This is fixed by pinning to 0.4.0.0

Repro steps

Please provide the steps required to reproduce the problem

  1. clone https://github.com/elastic/windows-installers

  2. checkout commit 0dafe2cea85489a51da534f2bc129f1119349961

  3. run build.bat in root to pull all dependencies down and build the project.

  4. update Fody in paket.dependencies to

    nuget Fody 1.29.4 content: none
    
  5. run .\.paket\paket.exe update nuget Fody version 1.29.4

Expected behavior

Fody package is updated.

Actual behavior

Error shown above

Known workarounds

Pinning MahApps.Metro.Resources to exactly 0.4 solves the issue.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
cloudRoutinecommented, May 10, 2017

Simpler repro for anyone else working on this paket-2326.zip

0reactions
matthidcommented, Jul 9, 2017

I’m closing this as by design. Note that my last example is now working:

source https://api.nuget.org/v3/index.json

nuget MahApps.Metro 1.0.1-ALPHA027 prerelease framework: >= net45
nuget MahApps.Metro.Resources 0.4 framework: >= net45

In general it should be working as soon as you specify all packages which should be allowed to be used as prerelease in the dependency file. Feel free to open another issue if this is not the case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NuGet unable to find the version of a package
gives this error: Unable to find version '1.0.0' of package 'Microsoft.Net.Compilers'. where the package has previously been installed ...
Read more >
NuGet Package Dependency Resolution
Details on the process through which a NuGet package's dependencies are resolved and installed in both NuGet 2.x and NuGet 3.x+.
Read more >
FAQ — Frequently Asked Questions
If it exists, Paket will ensure that the same versions are used when restoring packages. It is not strictly necessary to commit this...
Read more >
Getting Started with Paket – Part 1 - The Cockney Coder
Unfortunately, this introduces a new problem – since NuGet doesn't record the versions of your transitive dependencies, you can't be sure that ...
Read more >
NuGet packages in the Package Registry
When you publish a package with the same name or version as an existing package, the existing package is overwritten. Do not allow...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found