c# – MauiAsset with custom LogicalName build error on Mac


I have some json files in the shared project of my migrated Xamarin.Forms solution

in multi project structure, that appear in csproj like:

<ItemGroup>
    <MauiAsset Include="Resources\Animations\*" LogicalName="%(RecursiveDir)\Animations\%(Filename)%(Extension)"/>
</ItemGroup>

Which builds correctly in VS2022 on Windows.

In visual Studio for Mac however I get a build error:

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.4.7125/tools/msbuild/iOS/Xamarin.Shared.targets(3,3): Error: System.IO.IOException: Read-only file system : ‘/Animations’
at System.IO.FileSystem.CreateDirectory(String fullPath, UnixFileMode unixCreateMode)
at System.IO.Directory.CreateDirectory(String path)
at Xamarin.MacDev.Tasks.SmartCopyTaskBase.EnsureDirectoryExists(String path) in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/SmartCopyTaskBase.cs:line 53
at Xamarin.MacDev.Tasks.SmartCopyTaskBase.Execute() in /Users/builder/azdo/_work/1/s/xamarin-macios/msbuild/Xamarin.MacDev.Tasks/Tasks/SmartCopyTaskBase.cs:line 94 (PetActivityMobile.iOS)

If I remove the ‘\Animations’ part from the logical name,

it compiles, but it’s not the result I want.

Is there a way to get it to stay that way, maybe some configuration

or separate into android and ios logical name with the same path only different writing?

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img