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

[Bug] NuGet files not found - possible file length limitation? #66

Closed
vchelaru opened this issue Sep 23, 2024 · 4 comments
Closed

[Bug] NuGet files not found - possible file length limitation? #66

vchelaru opened this issue Sep 23, 2024 · 4 comments
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists question Further information is requested

Comments

@vchelaru
Copy link

vchelaru commented Sep 23, 2024

Description

Steps to Reproduce

  1. Install the NuGet package to a dotnet MAUI app that includes iOS
  2. Attempt to add the project and build
  3. Observe output

Expected Behavior

  • NuGet packages should install correctly and not interrupt project building.

Actual Behavior

  • Packages fail to install:
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
Error occurred while restoring NuGet packages: Could not find a part of the path 'C:\Users\Owner\.nuget\packages\xamarin.firebase.ios.installations\8.10.0.3\lib\net6.0-ios15.4\Firebase.Installations.resources\FirebaseInstallations.xcframework\ios-arm64_x86_64-simulator\FirebaseInstallations.framework\Headers\FirebaseInstallations-umbrella.h'.

I suspect this may be happening because of file length limitations; however, I did specify supporting long file paths in the registry:

image

And also in the local group policy:

image

I realize that this is not necessarily a problem with this nuget package; however, this package does result in very long file names, and I'm guessing this may be the problem. Also, I've encountered this problem on multiple machines (mine and my co-workers) which started when we added this library.

If it is truly a windows (or NuGet) configuration problem, perhaps the docs could explain how to avoid this issue?

EDIT 1:
For some reason the errors are inconsistent but they all seem to have to do with nuget files. Here's another set of errors:

2>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(5034,5): error MSB3030: Could not copy the file "C:\Users\Owner\.nuget\packages\xamarin.firebase.ios.installations\8.10.0.3\lib\net6.0-ios15.4\Firebase.Installations.resources\FirebaseInstallations.xcframework\ios-arm64_x86_64-simulator\FirebaseInstallations.framework\Headers\FirebaseInstallations-umbrella.h" because it was not found.
2>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(5034,5): error MSB3030: Could not copy the file "C:\Users\Owner\.nuget\packages\xamarin.firebase.ios.installations\8.10.0.3\lib\net6.0-ios15.4\Firebase.Installations.resources\FirebaseInstallations.xcframework\ios-arm64_x86_64-simulator\FirebaseInstallations.framework\Headers\FIRInstallationsAuthTokenResult.h" because it was not found.

Basic Information

  • Version with issue: 2.4.22
  • Last known good version: Unknown

Screenshots

N/A

Reproduction Link

@vchelaru vchelaru added the bug Something isn't working label Sep 23, 2024
@thomasgalliker
Copy link
Owner

#31 and #61 did report the same issue.

If anyone finds a solution on this, I'll update the docs for sure. The thing is, I cannot reproduce it on my Windows 10 machine with Visual Studio nor on the mac with Rider.

@thomasgalliker thomasgalliker added duplicate This issue or pull request already exists question Further information is requested labels Sep 24, 2024
@vchelaru
Copy link
Author

As I've been researching it, it seems there is no sure-fire solution if you are using Visual Studio - it's ultimately a problem with Visual Studio. There are workarounds, and some of them work okay. Here's a summary of what I've found. You can...

  • Use Rider
  • Build from the command line rather than Visual Studio
  • Move your project to the root of your machine such as c:\prj
    • Place your csproj in the same folder as your .sln rather than embedding your csproj one level deeper
    • Change the output directory for your project to be outside of the usual bin/XXXX folder. You can even use absolute paths like c:\bld
  • Add a config file for nuget so that all nuget packages are cached locally in a folder close to your root, such as c:\ng

I'm being somewhat vague here rather than giving exact suggestions because this is covered fairly well in this github issue:

dotnet/maui#17828

Also, the problem seems to be ultimately caused by Visual Studio, and this suggestion is open at the time of this writing. If this affects you then please upvote - maybe it has an impact: https://developercommunity.visualstudio.com/t/Allow-building-running-and-debugging-a/351628

It's worth noting that this specific package is even referenced there:

23_15 06 29

Also it's worth mentioning that there's another firebase library (sorry for mentioning the competition) which calls out this issue as well: https://github.com/TobiasBuchholz/Plugin.Firebase?tab=readme-ov-file#windows-11-long-path-issue

Perhaps this info is enough but it's also possible that others may not find this issue yet run into this problem so having it on the main page would be helpful.

Feel free to close this issue if you think this comment is sufficient for others who may run into this problem.

@thomasgalliker
Copy link
Owner

Thanks for your research, much appreciated! I‘ll update the FAQ.md in this repo with your findings.

@thomasgalliker thomasgalliker self-assigned this Sep 30, 2024
@thomasgalliker
Copy link
Owner

I updated the FAQ.md in this repository. Thanks again for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants