Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

ProjectResolver throws when resolving ambiguous project names #1854

Merged
merged 1 commit into from
May 13, 2015

Conversation

ChengTian
Copy link
Contributor

parent #1818

{
var allCandidatePaths = string.Join(Environment.NewLine, candidates.Select(x => x.FullPath).OrderBy(x => x));
throw new InvalidOperationException(
$"'{name}' is an ambiguous name resolved to following projects:{Environment.NewLine}{allCandidatePaths}");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The project name '{name}' is ambiguous between the following projects

@ChengTian ChengTian changed the title Wei/throws when resolve ambiguous project names ProjectResolver throws when resolving ambiguous project names May 13, 2015
@ChengTian
Copy link
Contributor Author

@davidfowl , thanks for the feedback, updated.

@ChengTian
Copy link
Contributor Author

Just came up with an edge case where you have the following global.json:

{
  "projects": ["src", "src/../src"]
}

This will make ProjectResolver throw, even you only have a single project src/ProjectA. And the error message can be very confusing:

The project name 'ProjectA' is ambiguous between the following projects:
<Root>/src/ProjectA
<Root>/src/ProjectA

Need to dedup. Working on it.

@ChengTian
Copy link
Contributor Author

@davidfowl , added dedup of project path and added tests for the case above.

@davidfowl
Copy link
Member

Good catch! :shipit:

- ProjectResolver checks project.json for disambiguation
- Dedup project path in initialization of ProjectResolver
- Add functional tests for ProjectResolver
@ChengTian ChengTian force-pushed the wei/throws-when-resolve-ambiguous-project-names branch from 3ae25ba to 2cdca3f Compare May 13, 2015 21:58
@ChengTian ChengTian merged commit 2cdca3f into dev May 13, 2015
@ChengTian ChengTian deleted the wei/throws-when-resolve-ambiguous-project-names branch May 13, 2015 21:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants