Skip to content

invoke a dotnet tool with multiple *proj in same directory is not possibile #7226

@enricosada

Description

@enricosada

Steps to reproduce

Or:

Or:

  • inside a directory
    • create a lib with name lib1.csproj
    • create a lib with name lib2.csproj
  • Add any tool (for example dotnet-mytool) inside one or both projects
  • dotnet restore lib1.csproj works
  • dotnet restore lib2.csproj works
  • dotnet mytool fails

Expected behavior

It's possibile like with dotnet restore to invoke the tool command somehow.
The dotnet mytool should fail only if ambiguous (both lib project define mytool), otherwise should work (best experience).
But expecit passing the project name maybe, like dotnet -p lib1.csproj mytool should make the tool work

I think the issue is because the old project.json was one for directory, so the check to resolve the project to use was ok.

Actual behavior

Error:

Specify which project file to use because this 'e:\repro' contains more than one project file.

Environment data

.NET Command Line Tools (1.0.0-preview3-004056)

Product Information:
 Version:            1.0.0-preview3-004056
 Commit SHA-1 hash:  ccc4968bc3

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64

ref dotnet/netcorecli-fsc#47

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions