Sdk: "Cycle detected" error restoring xunittest project on Windows 2016 Nano

Created on 10 Jun 2016  路  9Comments  路  Source: dotnet/sdk

Steps to reproduce

Create a new xunittest project on Windows 2016 Nano, and restore it:

[40.78.96.241]: PS C:\x2> C:\dotnet\dotnetnano\dotnet new -t xunittest
Created new C# project in C:\x2.
[40.78.96.241]: PS C:\x2> C:\dotnet\dotnetnano\dotnet restore
log  : Restoring packages for C:\x2\project.json...
error: Cycle detected:
error:   x2 (>= 1.0.0) -> xunit (>= 2.1.0) -> xunit (>= 2.1.0) -> xunit (>= 2.1.0).
log  : Writing lock file to disk. Path: C:\x2\project.lock.json
log  : C:\x2\project.json
log  : Restore failed in 2781ms.
C:\dotnet\dotnetnano\dotnet :
    + CategoryInfo          : NotSpecified: (:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Errors in C:\x2\project.json
    Cycle detected:
      x2 (>= 1.0.0) -> xunit (>= 2.1.0) -> xunit (>= 2.1.0) -> xunit (>= 2.1.0)

Expected behavior

dotnet restore works.

Actual behavior

dotnet restore reports "cycle detected" error for xunit.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview2-003024)

Product Information:
 Version:            1.0.0-preview2-003024
 Commit SHA-1 hash:  ef4a8e85ef

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14300
 OS Platform: Windows
 RID:         win10-x64
Area-External Bug

Most helpful comment

I just hit this, just now. We need a better error message. There's literally no way for someone to figure this out except for Google. Is that OK? /cc @blackdwarf @davidfowl

All 9 comments

@ericstj @rrelyea any ideas?

Did you have another folder in some directory named 'xunit'?

Did you have another folder in some directory named 'xunit'?

It's possible that there was an "xunit" directory off of the root. So:

c:\x2 <-- where the project was
c:\xunit <-- where I'd started a different project (IIRC)

Why would that make a difference?

Because Nuget tries to find local projects that might replace package references.

See https://github.com/NuGet/Home/issues/1428

Ok, that does seem to explain it. Closing this issue.

I just hit this, just now. We need a better error message. There's literally no way for someone to figure this out except for Google. Is that OK? /cc @blackdwarf @davidfowl

@shanselman this is something that we should file on NuGet/Home, since dotnet restore pass through to NuGet. The error messages comes from there as well, AFAIK.

obviously is too late but maybe this will help someone, i was getting this error and was caused because Rider created a reference into the csproj file to itself, i expend some hours before realize this was the issue, of course it was a terrible face palm

Was this page helpful?
0 / 5 - 0 ratings

Related issues

noelitoa picture noelitoa  路  3Comments

gkhanna79 picture gkhanna79  路  3Comments

fmorriso picture fmorriso  路  3Comments

dsplaisted picture dsplaisted  路  3Comments

moozzyk picture moozzyk  路  3Comments