Open KanniyappanP opened 3 years ago
Make sure you've turned on long path support: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later
I am experiencing the same problem. I tried the approach recommended, but I received a DEP 1000 error.
Describe the bug
We have a WinUI Desktop application with a class library, but when we try to build it, we get the error "Unable to copy class library files (used .xaml or.txt files) files when compiling WinUI Desktop project." It occurs as a result of accessing files with long file paths and running projects in long directories. The reported issue does not occur if I move the project location closer to the root directory. Can you please confirm whether this is a bug or expected behavior in WinUI? If this is a bug, any suggestions for a workaround would be greatly appreciated.
Please find the issue details below.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\DesktopBridge\Microsoft.DesktopBridge.targets(805,5): error MSB3021: Unable to copy file "C:\Users\Public\Documents\Kanniyappan\WinUI\19.3.0.43\SampleBrowser\WinUIClassLibrary\obj\Debug\net5.0-windows10.0.19041.0\Views\Getting started\GettingStarted.xaml" to "C:\Users\Public\Documents\Kanniyappan\WinUI\19.3.0.43\SampleBrowser\WinUIDesktopAppTest\WinUIDesktopAppTest\WinUIDesktopAppTest (Package)\bin\x86\Debug\Microsoft.SampleBrowser.WinUI_Net50\Microsoft.ClassLibrary.WinUIDemos_Net50\Views\Getting started\GettingStarted.xaml". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. 3>Done building project "Microsoft.SampleBrowser.WinUI_Net50 (Package).wapproj" -- FAILED.
Steps to reproduce the bug
Expected behavior Please confirm whether the copying problems in WinUI are a bug or a limitations/expected of WinUI.
Screenshots Errors details are shared as code snippet.
Version Info
NuGet package version: [Microsoft.WindowsAppSDK 0.8.1]
OS Version: Windows 10 20H2 (19042.1237)
Additional context