dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.65k stars 1.05k forks source link

dotnet tool install fails when there are multiple .csproj files in directory #9623

Open logankp opened 6 years ago

logankp commented 6 years ago

Steps to reproduce

Expected behavior

Tool installs correctly.

Actual behavior

Tool install fails with the following error: "Specify which project file to use because this '/sln' contains more than one project file."

Environment data

.NET Core SDK (reflecting any global.json): Version: 2.1.302 Commit: 9048955601

Runtime Environment: OS Name: debian OS Version: 9 OS Platform: Linux RID: debian.9-x64 Base Path: /usr/share/dotnet/sdk/2.1.302/

Host (useful for support): Version: 2.1.2 Commit: 811c3ce6c0

.NET Core SDKs installed: 2.1.302 [/usr/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

fbouteruche commented 5 years ago

It is the same issue if you want to run a global tool in a folder that contains multiple project files.

JimSuplizio commented 1 year ago

I also ran into this issue. I'm installing a tool that's published to one of our dev feeds, on Linux, in a repository that happens to have .proj files (note: it isn't just csproj, it's also .proj) at the root. I was able to get around this by setting the working directory to one that doesn't have any proj files in it but this seems wrong, considering it's only installing and not building. As stated above, this works fine on Windows, it only seems to be Linux and Mac.

brunzefb commented 1 month ago

I ran into this -- pretty annoying. Had to rename the other csproj.