4
votes

I have two pre-release nuget packages A.nuget and B.nuget, and B depends on A.

Install A.nuget works:
nuget.exe install A -Source E:\out\packages -OutputDirectory e:\NugetCache -Prerelease -PackageSaveMode nuspec;nupkg

Installing B.nuget fails:
nuget.exe install B -Source E:\out\packages -OutputDirectory e:\NugetCache -Prerelease -PackageSaveMode nuspec;nupkg

Unable to resolve dependency 'A.1.0.0.196-moma159241025'

I double checked and A.1.0.0.196-moma159241025 is installed under e:\NugetCache.

How can I resolve this error?

1
What was your order of operations? Which did you install first, A.nuget, or B.nuget?user1789573
A was installed first.Mohamed Mansour
So far I've only managed to resolve this if there's a non-prerelease version available that I can then upgrade.Zhaph - Ben Duguid

1 Answers

0
votes

The work-around I use to solve this uses the -IgnoreDependencies switch, meaning the chosen package will install without its dependencies, regardless of whether Nuget can find them or not.

  • Install all packages "B" depends on (including "A")
  • Install package "B" using the -IgnoreDependencies switch

    Install-Package A -IncludePrerelease
    Install-Package SomeDependencyFromB
    Install-Package SomeOtherDependencyFromB
    Install-Package B -IncludePrerelease -IgnoreDependencies

https://docs.nuget.org/consume/package-manager-console-powershell-reference