invoke a dotnet tool with multiple *proj in same directory is not possibile
See original GitHub issueSteps to reproduce
Or:
- download https://github.com/dotnet/netcorecli-fsc/tree/eb4a2943518e7c188c6e33939246158623d679e0/test-msbuild/TestMultipleLibraryInSameDir
dotnet restore Test1Library.fsproj
okdotnet restore Test2Library.fsproj
okdotnet compile-fsc
fails
Or:
- inside a directory
- create a lib with name
lib1.csproj
- create a lib with name
lib2.csproj
- create a lib with name
- Add any tool (for example
dotnet-mytool
) inside one or both projects dotnet restore lib1.csproj
worksdotnet restore lib2.csproj
worksdotnet 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
Issue Analytics
- State:
- Created 7 years ago
- Reactions:17
- Comments:12 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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).
Related: https://github.com/dotnet/cli/issues/6267 https://github.com/xunit/xunit/issues/1360
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.