NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

Cannot name a project by the same name of one of the package dependencies #936

Closed yishaigalatzer closed 8 years ago

yishaigalatzer commented 9 years ago

A project using project.json cannot be named the same as one of it's package dependencies.

The restore code confuses the project with the dependency and creates a cycle error.

Repro: Create a project named MvvmLight Install the package MvvmLight into the project

Result: Cycle detection and error restoring the package.

The project is considered MvvmLight 1.0 package, and it detects MvvmLight 5.3 as a cyclical dependency

emgarten commented 8 years ago

Projects and packages are generally treated as the same thing. The identity consists of the id and version.

The root level project is special cased and not written into the lock file, so potentially this issue could be fixed, however if that project is then referenced by another project there will be two items in the lock file target graph with the same name (a project and package), and that is not allowed today.

Example: A -> B -> B Unless the type is added to the identity there isn't a good way to make this scenario possible.