Search code examples
c#mauiclass-library

.Net Maui Balzor App crashes during startup on local ios device


Currently I try to program a ios mobile app with .net maui. This app works in the ios simulator, android simulator and on the windows machine itself. But when I try this app with a local ios device the app starts and crashes during the launching process.

We found out that our class library is not working with a .net maui app, but only if you test it on a local device. Is there a way to get this working? We catched a error something like "ZstdNet.CompressionOptions"

We tried to put everything in a .net maui class library, but if we do so. All other projects are not function correctly.

For reproduce

  1. Create .Net Maui Blazor App Project
  2. Create class library Project
  3. Add project reference in the maui app
  4. Connect iphone to computer and try to run it

Solution

  • Edit your csproj file using any editor

    Add in PropertyGroup

     <PropertyGroup>
    ...
        <UseInterpreter>true</UseInterpreter>
        <MtouchLink>None</MtouchLink>
    ...
    </PropertyGroup
    

    Hope it helps