gregor.tusar
06/24/2024, 8:26 AMCannot evaluate the item metadata "%(FullPath)". The item metadata "%(FullPath)" cannot be applied to the path "App_Plugins\my-welcome-dashboard\node_modules\%40umbraco-cms\backoffice\dist-cms\packages\documents\documents\user-permissions\input-document-granular-user-permission\input-document-granular-user-permission.element.d.ts". Path: C:\src\COM\MyCom\src\Cms\MyCom.Cms\App_Plugins\my-welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\documents\documents\user-permissions\input-document-granular-user-permission\input-document-granular-user-permission.element.d.ts exceeds the OS max path limit. The fully qualified file name must be less than 260 characters.
I excluded the node_modules
folder from solution, but the compiler still tries to do something with it.
<ItemGroup>
<None Remove="App_Plugins\my-welcome-dashboard\node_modules\**" />
</ItemGroup>
Has anyone faced this issue and solved it?Dean Leigh
06/24/2024, 8:28 AMgregor.tusar
06/24/2024, 8:29 AMDean Leigh
06/24/2024, 8:30 AMgregor.tusar
06/24/2024, 8:30 AMDean Leigh
06/24/2024, 8:30 AMDean Leigh
06/24/2024, 8:30 AMDean Leigh
06/24/2024, 8:32 AMDean Leigh
06/24/2024, 8:32 AM<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<ws2:longPathAware>true</ws2:longPathAware>
</windowsSettings>
</application>
Dean Leigh
06/24/2024, 8:32 AMgregor.tusar
06/24/2024, 8:34 AMDean Leigh
06/24/2024, 8:34 AMDean Leigh
06/24/2024, 8:37 AMDean Leigh
06/24/2024, 8:37 AMstring longPath = @"\\?\C:\very\long\path\to\file.txt";
string fullPath = Path.GetFullPath(longPath);
Dean Leigh
06/24/2024, 8:38 AMDean Leigh
06/24/2024, 8:39 AMDean Leigh
06/24/2024, 8:39 AMkdx-perbol
06/24/2024, 10:40 AMdotnet publish
solution we talked about in the other post works for the rest of us. Wasn't it just deploying to Azure you ultimately had problems with?gregor.tusar
06/24/2024, 11:17 AMSeverity Code Description Project File Line Suppression State
Error (active) MSB3021 Unable to copy file "C:\src\Com\MyCom\src\Cms\MyCom.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-type-configuration\property-editor-ui-block-grid-type-configuration.element.js" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-type-configuration\property-editor-ui-block-grid-type-configuration.element.js". Could not find a part of the path 'bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-type-configuration\property-editor-ui-block-grid-type-configuration.element.js'. MyCom.Cms C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 5270
I suspect that the reason for this is that also the destination folder path becomes too long and copy fails...gregor.tusar
06/24/2024, 11:49 AMbin\Debug\net8.0\
directory.
https://cdn.discordapp.com/attachments/1254714339211083889/1254765266303324180/image.png?ex=667ca8f7&is=667b5777&hm=54cb311bed7f95db07cc9175a17171d9039236c4ce9aebff048c86f59c8b06fa&gregor.tusar
06/26/2024, 5:36 AMkdx-perbol
06/26/2024, 6:55 AMcsc.exe
under the hood to do the web publish, and csc.exe
isn't long-path enabled. dotnet publish
works though, and then you have to publish your app some other way using msdeploy
or the Azure CLI or the Azure Publish VS Code plug-in. There was no actual resolution to the path-too-long problem in that post (except using dotnet publish
instead of VS Web Publish). Your problem sounds like something in Visual Studio is insisting on "building" the node folder.
The workaround found in that post was to use the shortest root path possible for your Umbraco project folder, e.g. A:\U\
, that works for an out-of-the-box Umbraco 14 web project but maybe not when building a custom dashboard plugin.gregor.tusar
06/26/2024, 11:32 AMkdx-perbol
06/26/2024, 1:40 PMDean Leigh
06/26/2024, 3:03 PMgregor.tusar
06/27/2024, 1:00 PMC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
.
So VisualStudio used different MSBuild version as dotnet build
. If I ran the build from CLI the build was successful but from VS it failed. So I knew there must be some difference.
ps1
PS C:\src> msbuild -version
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\src> dotnet msbuild -version
MSBuild version 17.10.4+10fbfbf2e for .NET
17.10.4.21802
Then I replaced the PATH value with C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\
and then the used versions of the MSBuild were the same:
ps1
PS C:\src> msbuild -version
MSBuild version 17.10.4+10fbfbf2e for .NET Framework
17.10.4.21802
PS C:\src> dotnet msbuild -version
MSBuild version 17.10.4+10fbfbf2e for .NET
17.10.4.21802
And after that the problem with long path names went away.
I hope it helps you too 🙂Dean Leigh
06/27/2024, 1:54 PMkdx-perbol
06/27/2024, 4:22 PMdotnet build/publish/restore
you could say. MSBuild is used by VS and by many Azure DevOps pipes. MSBuild can also "publish" in the "deploy" sense (not the dotnet publish
sense) and that's what happens in Azure DevOps release pipes. Siblings to MSBuild are msdeploy
(the old deployment tool) and csc
(the old C# compiler) and both of these are also used by VS and Azure DevOps pipes. Some of these tools are long-path enabled, but not csc
(which is used by VS Web Publish, for some very strange reason) and pre-2022 MSBuild. No idea about MSDeploy. These tools are from the .NET Framework days and only exist on Windows.kdx-perbol
06/27/2024, 4:22 PMDean Leigh
06/27/2024, 4:23 PMDean Leigh
06/27/2024, 4:24 PMkdx-perbol
06/27/2024, 4:27 PMDean Leigh
06/28/2024, 9:39 AMDean Leigh
06/28/2024, 9:40 AMkdx-perbol
06/28/2024, 11:54 AMkdx-perbol
06/28/2024, 11:55 AMkdx-perbol
06/28/2024, 11:56 AMkdx-perbol
06/28/2024, 11:56 AMkdx-perbol
06/28/2024, 11:57 AM