0

When I try to deploy my .NET MAUI App to iOS, I am facing the following error and it does not deploy

ILStrip failed for obj/Release/net7.0-ios/ios-arm64/de/OptimizerApp.resources.dll: File '/Users/oxo/Library/Caches/Xamarin/mtbs/builds/OptimizerApp/f234940a1c1d1645150df00f490ba852c822244a26b754b38b90d1e8a2d0a6d5/obj/Release/net7.0-ios/ios-arm64/de/OptimizerApp.resources.dll' not found. OptimizerApp C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.7054\targets\Xamarin.Shared.Sdk.targets 760

Obviously it does not find *.resource.dll

In my .NET MAUI App Project, I have a lot of resources below the Resources folder including .svg/.png (Properties: MauiImage), fonts, resource-Dictionaries (*.resx)

enter image description here.

I can't setup all of them as embedded resource or so. So what does determine that it wants to have a OptimizerApp.resources.dll and how would I get it when I want to have embedded resources?

Or is there anything else missing, I do not consider with this message?

enter image description here

OXO
  • 391
  • 1
  • 8
  • Hi, is this happen on both simulator and physical device? Release or debug? – Liqun Shen-MSFT Jun 26 '23 at 02:23
  • On the internet I could find a „solution“ for that ``` false ``` which seems to suppress the error, but just disabling it, also seems strange. It was when I tried to deploy to a physical device – OXO Jun 26 '23 at 04:20
  • Glad you solved the issue. You may post an answer and accept it below which may help others with similar issues. – Liqun Shen-MSFT Jun 26 '23 at 04:27

1 Answers1

0

A way to get rid of the error is by adding the following PropertyGroup to your csproj:

<PropertyGroup Condition="'$(TargetFramework)' == 'net7.0-ios'">
    <EnableAssemblyILStripping>false</EnableAssemblyILStripping>
</PropertyGroup>
OXO
  • 391
  • 1
  • 8