-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
dotnet list package
fails when current directory path contains #
character
#19654
Comments
dotnet/msbuild#2178 and linked issues likewise describe problems with special characters. But the documentation that was added in dotnet/docs#22517 does not cover |
@allanrodriguez
|
@KalleOlaviNiemitalo I think my issue is a little different; most @erdembayar I get the same results as you on my Windows machine, even without adding a package. It's when using my macOS machine that I see this issue. This is the full output of my repro steps on macOS, including adding a package before running
Specifying the project file in the command works fine though:
|
I can repro this sdk 5.0.203 on MAC, it looks subtle bug. |
@allanrodriguez |
@erdembayar I can create an issue in the nuget repo, but first I wanted to confirm that the issue isn't in this repo. I ask because the error message returned from sdk/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommand.cs Line 122 in e9667ae
sdk/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/LocalizableStrings.resx Lines 156 to 158 in e9667ae
|
I suspect the bug is in PathUtility.GetAbsolutePath, which uses the Uri class even though the input is not URI-encoded: sdk/src/Cli/Microsoft.DotNet.Cli.Utils/PathUtility.cs Lines 237 to 238 in e9667ae
It is called from the ListPackageReferencesCommand constructor: sdk/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommand.cs Lines 31 to 32 in e9667ae
|
I'm not sure, but in our repo we already have unit test for |
I can confirm @KalleOlaviNiemitalo's findings. After copying the
Maybe using |
According to https://github.com/dotnet/sdk/search?q=GetAbsolutePath, PathUtility.GetAbsolutePath does not seem to be used elsewhere in this repository. Unfortunately, it has already been shipped in the Microsoft.DotNet.Cli.Utils 2.0.0 NuGet package, so I guess it will need to be fixed even if ListPackageReferencesCommand is changed to use Path.GetFullPath instead. |
Thanks for creating this issue! We believe this issue is related to NuGet tooling, which is maintained by the NuGet team. Thus, we closed this one and encourage you to raise this issue in the NuGet repository instead. Don’t forget to check out NuGet’s contributing guide before submitting an issue! If you believe this issue was closed out of error, please comment to let us know. Happy Coding! |
When running
dotnet list package
while in the directory of a project with a#
character in its path, I get the following error:This works fine when the path doesn't contain a
#
character, or if I specify the project name in the command:Steps to reproduce
C#
andcd
into it.dotnet new console -n Test -o .
)dotnet list package
and observe the issue described above.Other observations
dotnet list reference
doesn't seem to have this issue.Environment
The text was updated successfully, but these errors were encountered: