maui: MAUI Blazor app with long reference paths fails to Deploy on Windows
Description
I’m using this public repo from our company. If I clone the repository into a relatively short path such as C:\git, it all works as expected. However, if I clone into a longer path, such as in C:\Users\TimPurdum\OneDrive - Dymaptic\git, all the applications work except the MAUI sample app, which throws the following exception:
DEP1000: Cannot copy file "C:\Users\TimPurdum\OneDrive - Dymaptic\Documents\dy-blazor-api-core\samples\dymaptic.Blazor.GIS.API.Core.Sample.Shared\obj\Debug\net6.0\scopedcss\projectbundle\dymaptic.Blazor.GIS.API.Core.Sample.Shared.bundle.scp.css" to layout "C:\Users\TimPurdum\OneDrive - Dymaptic\Documents\dy-blazor-api-core\samples\dymaptic.Blazor.GIS.API.Core.Sample.Maui\bin\Debug\net6.0-windows10.0.19041.0\win10-x64\AppX\wwwroot\_content\dymaptic.Blazor.GIS.API.Core.Sample.Shared\dymaptic.Blazor.GIS.API.Core.Sample.Shared.bundle.scp.css". DirectoryNotFoundException - Could not find a part of the path 'C:\Users\TimPurdum\OneDrive - Dymaptic\Documents\dy-blazor-api-core\samples\dymaptic.Blazor.GIS.API.Core.Sample.Maui\bin\Debug\net6.0-windows10.0.19041.0\win10-x64\AppX\wwwroot\_content\dymaptic.Blazor.GIS.API.Core.Sample.Shared\dymaptic.Blazor.GIS.API.Core.Sample.Shared.bundle.scp.css'. [0x80070003] dymaptic.Blazor.GIS.API.Core.Sample.Maui
Steps to Reproduce
- Clone https://github.com/dymaptic/dy-blazor-api-core into a long file path, such as inside your
OneDrivedirectory. - Open the
src/dymaptic.Blazor.GIS.API.Core.slnin Visual Studio 2022 (I’m using the latest Preview). - Select and run the
.MAUIsample application, targetingWindows Machine.
Expected Outcome: Application starts and runs on Windows machine.
Actual Outcome: Error listed in description.
Link to public reproduction project repository
https://github.com/dymaptic/dy-blazor-api-core
Version with bug
6.0.400
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
Target Framework: net6.0-windows10.0.19041.0
Did you find any workaround?
Moving to a shorter file path works as a temporary workaround.
Relevant log output
No response
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 4
- Comments: 21 (2 by maintainers)
@datvm the only workaround I have found during development is to move my project into
C:\git\projectFolderor eventC:\projectFolder. However, if your example, it looks like you would have to move your.nugetfolder, which I’ve never tried to do.@jfversluis I can confirm that this still occurs on .NET 7.
Marc,
Thanks for your comment. I believe you are correct, my file paths listed above are just over the 260 limit. I was surprised because I was sure this limit had been raised/removed in recent versions of Windows.
I wonder if this still needs attention by someone at MS though, especially since ~85 characters (about a third) of the file path (
\bin\Debug\net6.0-windows10.0.19041.0\win10-x64\AppX\wwwroot\_content\and.bundle.scp.css) are non-negotiably created by .NET on deployment, and namespaces are repeated 3 times in the path (root folder,_contentfolder, and in the bundle name)?In the meantime, I will add your link to the documentation for our repository and package. Thanks again!