Maxim
Maxim

Reputation: 13468

.Net Core project.json multiple projects with the same name

I have project named Common placed in directory NamespaceA. I have project named Common placed in directory NamespaceB.

Now I want to reference first project inside second using project.json

But it is not possible!

error: Cycle detected: 
error:   Common (>= 9.0.0) -> Common (>= 9.0.0) -> Common (>= 9.0.0).

VS thinks that both are the same project!

Upvotes: 2

Views: 745

Answers (1)

Victor Hurdugaci
Victor Hurdugaci

Reputation: 28425

In project.json you reference NuGet packages. If you have multiple NuGet packages with the same, then the project system cannot figure out which one is which. So, unfortunately, your scenario is not supported. The only solution is to rename the packages.

It's almost like having two types with the same name, both imported and referencing them without the full name. The compiler will not know which to pick.

Upvotes: 2

Related Questions