Open jkasten2 opened 2 years ago
~I can repro this. I feel it's duplicate of https://github.com/NuGet/Home/issues/3324 Let's keep it open for now until discussion, this one is asking for warning other one is actual long path support, it looks we used to have long name warning in the past not sure why it doesn't show anymore.~
@jkasten2 I was able to make it work after enabling long file support.
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.
Press Win + R keys on your keyboard and type regedit then press Enter. Registry Editor will be opened. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem. Edit LongPathsEnabled and set it to 1.
Press Win + R keys on your keyboard and type gpedit.msc then press Enter. Group Policy Editor will be opened. Go to Local Computer Policy -> Computer Configuration -> Administrative Templates -> System -> Filesystem, then enable the Enable Win32 long paths option.
Restart your machine.
Please let me know if you have any other question.
@erdembayar Thanks for the quick reply!
I 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:
One-Line Summary
Nuget does not support paths over 260 / 248 characters on Windows per issue https://github.com/NuGet/Home/issues/3324, however it should reliability tell the developer this is the issue.
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.
- Press Win + R keys on your keyboard and type regedit then press Enter. Registry Editor will be opened. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem. Edit LongPathsEnabled and set it to 1.
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