[BUG] cycle error with dotnetcore3.0: error NU1108: LiteDB -> LiteDB (>= 5.0.5).
Version Which LiteDB version/OS/.NET framework version are you using. (REQUIRED)
Describe the bug A clear and concise description of what the bug is.
Code to Reproduce Write a small snippet to isolate your bug and could be possible to our team test. (REQUIRED)
Expected behavior A clear and concise description of what you expected to happen.
Screenshots/Stacktrace If applicable, add screenshots/stacktrace
Additional context Add any other context about the problem here.
Facing the same issue:
Version .Net Core 3.1.401 on WSL2 LiteDb 5.0.9
Describe the bug Cannot install the package LiteDB from a .Net console project: Cycle detected
Code to Reproduce
$ dotnet add package LiteDB --version 5.0.9
Determining projects to restore...
Writing /tmp/tmpxhD5VG.tmp
info : Adding PackageReference for package 'LiteDB' into project '/mnt/c/data/dev/fsharp-lab/LiteDb/LiteDb.fsproj'.
info : Restoring packages for /mnt/c/data/dev/fsharp-lab/LiteDb/LiteDb.fsproj...
error: Cycle detected.
error: LiteDb -> LiteDB (>= 5.0.9).
info : Package 'LiteDB' is compatible with all the specified frameworks in project '/mnt/c/data/dev/fsharp-lab/LiteDb/LiteDb.fsproj'.
error: Value cannot be null. (Parameter 'path1')
Expected behavior Should be able to install the package in the .Net project
Screenshots/Stacktrace See above
Additional context Detected the issue while trying to install LiteDB.FSharp
The error comes from the name of the project you're adding the package to, not from the package. In the log above the project is LiteDb/LiteDb.fsproj. NuGet treats an SDK-style project as a package whose id is its name, compared case-insensitively. So LiteDb -> LiteDB (>= 5.0.9) looks like a package depending on itself, and restore fails with NU1108. The LiteDB package has no dependency on itself.
Fix: rename the project, e.g. LiteDbLab.fsproj, or set a different id in the project file:
<PropertyGroup>
<PackageId>LiteDbLab</PackageId>
<AssemblyName>LiteDbLab</AssemblyName>
</PropertyGroup>
Then run dotnet add package LiteDB again. The same situation is described in #2329.
If this doesn't cover your case, comment here and we'll reopen it.