Reputation: 111
Building release of iOS MAUI app (Remote Device) failed with this error message:
Code MSB3191 Description Unable to create directory "obj/Release/net6.0-ios/ios-arm64//stripped/Microsoft.Extensions.DependencyInjection.Abstractions.dllDevelop\Test\MauiApp1\obj\Release\net6.0-ios\ios-arm64\linked". 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. File C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\15.4.446-ci.-release-6-0-4xx.446\targets\Xamarin.Shared.Sdk.targets Line 751
It is a new project created from template ".NET MAUI App" - I just changed Application ID and Provisioning profile. Windows 10, new installation of Microsoft Visual Studio Community 2022 (64-bit) - Current, Version 17.3.5. Connected to remote Mac with Xcode 13.3.1.
Debug build of iOS (Local Device or Remote Device) is ok. Release build of other platforms (Android, Windows) is ok...
Does anyone have any ideas on how to fix this?
Upvotes: 0
Views: 1573
Reputation: 111
Finally found the solution:
Executing the command dotnet workload restore "full-path-to-your-sln"
did the magic!
Update: Above command did not work - I had to opt-out ILStripping by editing project file. I added:
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Release|net6.0-ios'">
<EnableAssemblyILStripping>False</EnableAssemblyILStripping>
</PropertyGroup>
Upvotes: 5