1

.net MAUI Project based on .net version 7 getting crashed while I am trying to deploy it on device. Below is the exception I am getting: enter image description here

Visual Studio for Mac version :17.4(build 2406) .net version: .net 7 iPhone 13, iOS 16.3 below are the packages being used: enter image description here

Crashlogs: Unhandled Exception: System.TypeLoadException: Could not set up parent class, due to: Invalid generic instantiation assembly:/private/var/containers/Bundle/Application/8849B149-36C8-4750-86DD-2AAC2A958F3D//Microsoft.Maui.dll type:ViewHandler2 member:(null) at CommunityToolkit.Maui.AppBuilderExtensions.<>c.b__0_0(IMauiHandlersCollection h) in /_/src/CommunityToolkit.Maui/AppBuilderExtensions.shared.cs:line 28 at Microsoft.Maui.Hosting.HandlerMauiAppBuilderExtensions.HandlerRegistration.AddRegistration(IMauiHandlersCollection builder) at Microsoft.Maui.Hosting.Internal.MauiHandlersFactory.CreateHandlerCollection(IEnumerable1 registrationActions) at Microsoft.Maui.Hosting.Internal.MauiHandlersFactory..ctor(IEnumerable`1 registrationActions) at Microsoft.Maui.Hosting.HandlerMauiAppBuilderExtensions.<>c.b__1_0(IServiceProvider sp) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.<…>

4
  • To begin with, you can try to build in release mode instead of debug mode. If that doesn't work, please help provide more details on this issue like VS version, .NET version, iOS device information and the nuget packages. Feb 1 at 6:01
  • You have installed many packages so I can't judge if the issue still exists if add community toolkit package. You can try to create an empty project and add community toolkit package, then determine if the issue still exists. I suspect the issue is caused by the package Telerik.UI.for.Maui. You can refer to .NET MAUI Project - Could not set up parent class, due to: Invalid generic instantiation. Feb 3 at 0:57
  • @AlexandarMay-MSFT after further investigation of crash logs i found that there is an issue with CommunityToolkt.Maui package. Pasting the crashlogs in question.
    – Suyash
    Feb 6 at 5:13
  • If it's related with CommunityToolkt.Maui package, you can create an issue at github.com/CommunityToolkit/Maui/issues for help. Feb 6 at 7:03

1 Answer 1

0

Degrading CommunityToolkt.Maui version from 4.0.0 to 3.1 resolves the issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.