Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Steps to reproduce



  • 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


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


Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:17
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

angularsencommented, Aug 18, 2017

Can we add a project parameter?

Something like this: dotnet xunit TestProject.NetCore.csproj dotnet xunit TestProject.WindowRuntimeComponent.csproj

I have a dir with two test projects (to test same source with two different conditional compilation symbols).


benmccallumcommented, Oct 4, 2019

Somehow this isn’t an issue for me locally but is when used in a dockerfile. Super confused. My machine has the 3.0.100 SDK whereas I’m in a docker container using the 2.2 SDK image. Could this be fixed in 3.0? Can anyone else confirm?

Update: For kicks I changed the image to 3.0 one and it didn’t change anything. Same error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot .NET tool usage issues
Possible reasons for this include: * You misspelled a built-in dotnet command. * You intended to execute a .NET program, but dotnet-xyz does...
Read more >
how to compile dotnet project if you have more than one ...
1 Answer 1 ... You can run specific project by adding --project to dotnet run . ... dotnet run --ProjectNetCoreConsoleClient.csproj Specify which ...
Read more >
Compile multiple dotnet core projects in one step using ...
The dotnet build command accepts glob patterns. So you can do this: dotnet build Src/**/project.json.
Read more >
Msbuild get directory name. props imported, or something ...
My ultimate goal is to be able to invoke msbuild at the top folder, and have it build all csproj files in the...
Read more >
1. Solutions and Projects - Mastering Visual Studio .NET ...
If you select the Create directory for Solution checkbox, Visual Studio .NET will not place the solution files in the same directory as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found