Errors MSB3027 and MSB3021, cannot copy file

-- -- 957 Reputation points
2023-07-20T17:14:41.0033333+00:00

Hi

Visual Studio 2022.

Created my first MAUI solution using DevExpress MAUI template.

Compiling the solution I get errors given below at the end. I tried several thing, permissions on temp folder, changing temp folder to a different folder/drive. Nothing worked.

How can I fix these errors and get the solution build successfully?

Thanks

Regards

1>C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk\16.4.7054\tools\msbuild\iOS\Xamarin.iOS.HotRestart.targets(273,3): error MSB3027: Could not copy "C:\Users\AUser\.nuget\packages\devexpress.maui.controls\23.1.3\lib\net7.0-ios15.4\DevExpress.iOS.Navigation.resources\DXNavigation.xcframework\ios-arm64_x86_64-simulator\DXNavigation.framework\Headers\DXNavigationDrawerDataSource.h" to "F:\Temp\Xamarin\HotRestart\Signing\DemoCenter.Maui.app\out\Payload\DemoCenter.Maui.app\DemoCenter.Maui.content\DevExpress.iOS.Navigation.resources\DXNavigation.xcframework\ios-arm64_x86_64-simulator\DXNavigation.framework\Headers\DXNavigationDrawerDataSource.h". Exceeded retry count of 10. Failed.

1>C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk\16.4.7054\tools\msbuild\iOS\Xamarin.iOS.HotRestart.targets(273,3): error MSB3021: Unable to copy file "C:\Users\AUser\.nuget\packages\devexpress.maui.controls\23.1.3\lib\net7.0-ios15.4\DevExpress.iOS.Navigation.resources\DXNavigation.xcframework\ios-arm64_x86_64-simulator\DXNavigation.framework\Headers\DXNavigationDrawerDataSource.h" to "F:\Temp\Xamarin\HotRestart\Signing\DemoCenter.Maui.app\out\Payload\DemoCenter.Maui.app\DemoCenter.Maui.content\DevExpress.iOS.Navigation.resources\DXNavigation.xcframework\ios-arm64_x86_64-simulator\DXNavigation.framework\Headers\DXNavigationDrawerDataSource.h". Could not find a part of the path 'F:\Temp\Xamarin\HotRestart\Signing\DemoCenter.Maui.app\out\Payload\DemoCenter.Maui.app\DemoCenter.Maui.content\DevExpress.iOS.Navigation.resources\DXNavigation.xcframework\ios-arm64_x86_64-simulator\DXNavigation.framework\Headers\DXNavigationDrawerDataSource.h'.

Developer technologies .NET .NET MAUI
Developer technologies Visual Studio Other
{count} votes

2 answers

Sort by: Most helpful
  1. John Rutterford 5 Reputation points
    2023-09-07T03:21:27.26+00:00

    This is caused by Windows Long Path errors.

    The solution is to remove the Plugin.Firebase package.

    Then (very important) add it in again using the Developer Powershell:

    dotnet add package Plugin.Firebase
    
    1 person found this answer helpful.
    0 comments No comments

  2. Alessandro Caliaro 4,196 Reputation points
    2023-07-20T17:23:02.2466667+00:00

    I think the destination path is to long. Try to copy the project to a short root directory


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.