Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transitive lock files (with wildcard) result in NU1004 #8465

Closed
daniel-white opened this issue Aug 17, 2019 · 11 comments · Fixed by NuGet/NuGet.Client#4445
Closed

Transitive lock files (with wildcard) result in NU1004 #8465

daniel-white opened this issue Aug 17, 2019 · 11 comments · Fixed by NuGet/NuGet.Client#4445
Assignees
Labels
Area:RestoreRepeatableBuild The lock file features Category:Quality Week Issues that should be considered for quality week Functionality:Restore Priority:2 Issues for the current backlog. Type:Bug
Milestone

Comments

@daniel-white
Copy link

daniel-white commented Aug 17, 2019

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): dotnet cli

NuGet version (x.x.x.xxx):

dotnet.exe --version (if appropriate): 2.1.801

OS version (i.e. win10 v1607 (14393.321)): macOS 10.14.6 (18G87)

Worked before? If so, with which NuGet version: No

Detailed repro steps so we can see the same problem

  1. Create a .net standard project. Add a nuget reference with a wildcard version.

  2. Enable RestorePackagesWithLockFile.

  3. Run dotnet restore for the first project.

  4. Add another .net standard project. Reference the first project via project reference.

  5. Enable RestorePackagesWithLockFile.

  6. Run dotnet restorefor the second project.

  7. Run dotnet restore --locked-mode for the second project.

  8. Observe NU1004

...

Other suggested things

Verbose Logs

log.txt

Sample Project

locktest.zip

@daniel-white daniel-white changed the title Transitive lock files result in NU1004 Transitive lock files (with wildcard) result in NU1004 Aug 17, 2019
@nkolev92
Copy link
Member

@daniel-white
Can you please tell us which "wildcard" version you are referring to specifically?

There are some issues with *, but other versions like 1.* or 1.0.0-preview.* should work.

@nkolev92 nkolev92 added Area:RestoreRepeatableBuild The lock file features Type:Bug WaitingForCustomer Applied when a NuGet triage person needs more info from the OP Functionality:Restore labels Aug 19, 2019
@daniel-white
Copy link
Author

@nkolev92 the more specific versions like 1.* or 1.0.0-preview.*

@rrelyea
Copy link
Contributor

rrelyea commented Aug 20, 2019

(i'm assuming this was a problem with earlier nuget versions as well, right? this is not a regression?)

@daniel-white
Copy link
Author

@rrelyea I’m not sure. I know there were some other issues that prevented me from using the lock files before this version

@nkolev92 nkolev92 removed the WaitingForCustomer Applied when a NuGet triage person needs more info from the OP label Aug 20, 2019
@nkolev92
Copy link
Member

nkolev92 commented Aug 20, 2019

I verified, this is not a regression, it's always been an issue.

We have an issue with the way we express the dependencies of dependencies in the lock file.

The issue in the repro above specifically is:

      "locktest": {
        "type": "Project",
        "dependencies": {
          "Conga.Logging": "0.12.1-beta"
        }
      }

@andzn
Copy link

andzn commented May 11, 2021

We're running into the same issue. We are using dotnet 5.0.202. Is there a workaround or something we can try in the meantime?

@AlexKeySmith
Copy link

Hi, we're running into the same issue as well with 5.0.302

@AlexKeySmith
Copy link

I realise this is a super old ticket so I'm guessing not a widely seen issue.
Are we best to avoid wildcards in PackageReference entirely for packages.lock.json to work?

Or is it only in the more exotic like 4.0.0-beta.* in that case are we best to use version ranges perhaps (I think they opt into pre-release?).

I wonder is it something to do with by design floating versions not opting into pre-release versions.

@AlexKeySmith
Copy link

n.b. after much experimentation I was able to use version ranges, using this very helpful tool to iterate quickly https://nugettools.azurewebsites.net/5.9.1/find-best-version-match

However unfortunately version ranges seem to break whitesource (a dependency scanning tool I'm using) so in the end I switched to non-floating versions.

@ilya-git
Copy link

This issue is quite old, are there any plans to fix it or a workaround @nkolev92 ? I don't see what else I can do apart from not using wildcards?

@nkolev92
Copy link
Member

nkolev92 commented Feb 9, 2022

@martinrrm

#10458 is likely a duplicate of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:RestoreRepeatableBuild The lock file features Category:Quality Week Issues that should be considered for quality week Functionality:Restore Priority:2 Issues for the current backlog. Type:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants