-
Notifications
You must be signed in to change notification settings - Fork 253
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
[Bug]: Windows Only - nuget install fails with misleading error "Could not find a part of the path" instead of 260 / 248 character error #11953
Comments
@jkasten2 Here is how I enabled long file support, probably you don't need both of below steps, just 1 could be suffice. My case I did both, and it works.
Please let me know if you have any other question. |
@erdembayar Thanks for the quick reply! This issue's scopeI am focusing this issue to a nuget bug where the developer using nuget doesn't always get the over 260 character warning when they should:
Since it seems like #3324 won't be fixed for a while so I believe it is important to make sure nuget gives the correct error. Other documentation note
Would be good to add that registry option to https://aka.ms/nuget-long-path, as it only covers the Group Policy Editor option. 😄 |
Setting the long path support in the registry and the group policy doesn't seem to make any difference if you build inside of Visual Studio (2022). |
@erdembayar no worked. Windows 11 22H2 |
no work.... sames error |
Still having this issue, LongPathsEnabled does not fix it. |
I wanted review for LongPath Tool? has anyone used it? |
NuGet Product Used
NuGet.exe
Product Version
NuGet.exe 6.2.1
Worked before?
No response
Impact
It's more difficult to complete my work
Repro Steps & Context
One-Line Summary
Nuget does not support paths over 260 / 248 characters on Windows per issue #3324, however it should reliability tell the developer this is the issue.
Details
Given issue #3324 won't be fixed anytime soon and how often this limit is hit having good error messages is critical for developers to understand what the root issue when it is hit. While Nuget sometimes displays the following details when the 260 / 248 Windows path limit is reached it does NOT always do this:
The factor seems to be is nuget doesn't consider longer paths and file names in the nuget package itself. It seems it may use part of the name in the calculation if the warning is shown but if it gets this wrong you get a confusing message like this:
Steps to reproduce
I broke this down into two scenarios where a this "good" error message doesn't show when it should.
Steps to reproduce - Case 1 - Common Package with long project path
This one makes note of the case where we get a "bad" error message for a very common library
Newtonsoft.Json
but a less common very long pathed project.Run the following:
And observe the error:
However if you remove just 1 character from the path you get an expected error:
Run the following:
Gives you an understandable error.
Steps to reproduce - Case 2 - Less common package that has long contents
This one makes note of the case where we get a "bad" error message for a less common library
OneSignalSDK.Xamarin
.Run the following:
Gives you a confusing error about a the first file that just happens to go over the 260 Windows limit:
Verbose Logs
No response
The text was updated successfully, but these errors were encountered: