Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting deploy command's --project-path to project file in same folder fails when multiple project files present #829

Closed
Kirkaiya opened this issue May 8, 2024 · 2 comments
Labels
bug This issue is a bug.

Comments

@Kirkaiya
Copy link

Kirkaiya commented May 8, 2024

Describe the bug

Command dotnet aws deploy --project-path MyProject.csproj fails when run from within the folder containing the multiple project files:

..\eShop>dotnet aws deploy --project-path eShop.AspNetCore.csproj
Specify which project file to use because this 'C:\eShop' contains more than one project file.

However, if I run the command from one folder higher, and include the folder path, it then works
..\samples>dotnet aws deploy --project-path eShop\eShop.AspNetCore.csproj

The command also works from within the project folder if I pass the absolute path, like this:
dotnet aws deploy --project-path C:\eShop\eShop.AspNetCore.csproj

So there is an issue with the handling of the --project-path argument value, when it's specifying a filename in the same folder where the command is run. Trying various relative path tricks (e.g., --project-path ..\eShop\project.csproj) does not work either.

Expected Behavior

Specifying the filename as --project-path should work when the command is run within the same folder as the project files.

Current Behavior

The deploy command gives the following error:

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

Reproduction Steps

In a folder containing a .NET project, create an additional project file (.csproj for C#) with a different name. Then, open a terminal/console to that path. Then run dotnet aws deploy --project-path <one of the project filenames>

Possible Solution

The code that handles the relative paths or path resolution of the --project-path parameter has a bug. I have not looked at the source code for where the bug is.

Additional Information/Context

No response

Version used

1.20.8+645648dd1e

Operating System and version

Windows 11 Version 10.0.22621 Build 22621

@Kirkaiya Kirkaiya added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 8, 2024
@normj
Copy link
Member

normj commented May 8, 2024

Interesting the error is actually coming from the dotnet CLI not our tool. Looks like when you run dotnet aws before dotnet forwards to us it is running into confusion about the multiple projects.

You can work around this by using dotnet-aws, with the hyphen, which will skip the redirect that happens with the dotnet CLI.

@normj normj closed this as completed May 8, 2024
@normj normj removed the needs-triage This issue or PR still needs to be triaged. label May 8, 2024
Copy link

github-actions bot commented May 8, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants