SfButton not working on iOS when targeted to .NET 9
I am using sfButton inside sflistview template in my .net maui project
Just checked this again and seems to happening for all syncfusion controls
On another page, I have used SfTextInputLayout for which also I am getting similar issue:
{Microsoft.Maui.Controls.Xaml.XamlParseException: Position 48:26. No parameterless constructor defined for type 'Syncfusion.Maui.Core.SfTextInputLayout'.
---> System.MissingMethodException: No parameterless constructor defined for type 'Syncfusion.Maui.Core.SfTextInputLayout'.
at System.RuntimeType.CreateInstanceMono(Boolean , Boolean )
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean , Boolean )
at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at Microsoft.Maui.Controls.Xaml.CreateValuesVisitor.Visit(ElementNode node, INode parentNode)
Hi Simon,
Thank you for sharing the details of your query.
We’ve reviewed your scenario and tested a .NET 9.0 MAUI project on iOS using the latest Syncfusion controls. In our environment, we were unable to reproduce the issue you described. The SfButton rendered correctly without any errors.
To assist you further, we’ve attached a working sample for your reference. If the issue persists on your end, we kindly request you to modify our sample to replicate the error you faced and share the following details:
- MAUI Controls version
- Syncfusion nuget versions
- iOS simulator or device version
- Any additional configuration or build settings
This will help us investigate more precisely and provide a targeted solution. We’re happy to assist you further once we have this information.
Regards,
Priyadharshni M
Attachment: TextInputLayoutSample_d577e3ef.zip
Thanks for the update and sample project.
I have managed to resolve the issue. Following are the steps taken:
- Updated project to .NET 9 and upgraded Syncfusion controls to the latest available versions.
- Also upgraded the following packages to 9.0.100:
- Microsoft.Maui.Controls
- Microsoft.Maui.Controls.Compatibility
With these updates, the runtime errors mentioned above occurred.
I noticed the issue happens when the following is present in the .csproj file:
After commenting out this property group, the controls started working correctly.
My Understanding:
It appears that the iOS linker may be stripping constructors required for Syncfusion controls when MtouchLink=SdkOnly is enabled. With older versions of Syncfusion controls, the same setup worked without issues, but with the newer versions, the constructors seem to be trimmed.
Request for Clarification:
Could you please clarify if there were any internal changes in the latest controls related to constructors/XAML instantiation, and provide guidance or documentation on recommended project configuration for .NET 9 iOS builds?
This will help ensure that we configure our project correctly without having to disable linking entirely.
Environment:
- .NET:9.0
- Platform: iOS
- Syncfusion MAUI Controls: 30.2.7
- Microsoft.Maui.Controls: 9.0.100
- Microsoft.Maui.Controls.Compatibility: 9.0.100
Hi Simon,
Thank you for the detailed explanation. Our team is currently investigating this issue and will explore further possibilities. We’ll provide you with an update by September 3rd, 2025. We appreciate your understanding and patience.
Regards,
Priyadharshni M
Hi Simon,
Thank you for your detailed update and for sharing your findings regarding the iOS linker and Syncfusion controls on .NET 9.
We have thoroughly investigated the error you experienced and, as you observed, it is related to the iOS linker settings in your project configuration. When the following property group is used in your .csproj:
|
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0-ios|AnyCPU'"> <MtouchLink>SdkOnly</MtouchLink> </PropertyGroup> |
It can cause the linker to strip parameterless constructors required by Syncfusion controls, resulting in runtime errors such as No parameterless constructor defined for type 'Syncfusion.Maui.Core.SfTextInputLayout'.
Recommended Solution:
To resolve this, please update your project file to use the configuration below for your Debug|net9.0-ios|AnyCPU target:
|
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0-ios|AnyCPU'"> <MtouchLink>Full</MtouchLink> <_MauiForceXamlCForDebug>true</_MauiForceXamlCForDebug> <UseInterpreter>false</UseInterpreter> </PropertyGroup> |
These changes ensure the iOS linker does not remove constructors needed for runtime XAML instantiation of our components, and should prevent further issues without needing to disable linking entirely.
There have not been recent deliberate changes in our libraries specifically targeting constructors or XAML instantiation, but linking behaviors can vary between .NET versions and build configurations. The above project settings are our current recommended approach for .NET 9 iOS builds with Syncfusion components.
If you have any further questions or issues, please let us know. We’re happy to provide continued support!
Regards,
Kishore J
I also encountered the same error: when using .NET 9 + iOS linker = SdkOnly, the default ctor of SfButton / SfTextInputLayout was stripped — leading to the error No parameterless constructor defined.
The solution I am trying: change MtouchLink = Full + enable <_MauiForceXamlCForDebug>true</_MauiForceXamlCForDebug> in .csproj.
You can see more instructions on linker/iOS stripping here:
https://learn.microsoft.com/xamarin/ios/deploy-test/linker/solitaire bliss
https://learn.microsoft.com/dotnet/maui/ios/linking
If anyone has tried it, please share the results with me so we can solve it together
Hi Simon,
Thanks for the follow-up and for confirming your findings.
We were able to replicate the exception on .NET 9 iOS when using the following setting: SdkOnly This led to the “No parameterless constructor defined” error for controls like SfButton and SfTextInputLayout, as you observed.
As suggested earlier, the issue is resolved by updating the project configuration to:
|
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0-ios|AnyCPU'"> <MtouchLink>Full</MtouchLink> <_MauiForceXamlCForDebug>true</_MauiForceXamlCForDebug> <UseInterpreter>false</UseInterpreter> </PropertyGroup> |
We have attached two demos:
- Reproduced demo: shows the exception with MtouchLink=SdkOnly.
- Fixed demo: runs successfully with MtouchLink=Full + XAML C for Debug + UseInterpreter=false.
Please let us know if you have any other questions.
Regards,
Kishore J
Attachment: Demos_2812af2f.zip
I just downloaded 31.1.17. And now I have the same problem.
But the solutions with Full, MainForce... and UseInterpreter don't help me, because my app doesn't work at all anymore, as the data doesn't come back even on the first https call.
As soon as I use SdkOnly again, it works again – with the exception of the PDFViewer.
For such an expensive framework, you'd think you could expect it to work.
Hi Roland,
Thank you for your update and for testing with Syncfusion version 31.1.17.
We understand that switching to the recommended configuration (MtouchLink=Full, _MauiForceXamlCForDebug=true, UseInterpreter=false) causes your app to stop functioning correctly, particularly with HTTPS calls, and that reverting to SdkOnly resolves the issue — except for the PDFViewer.
To investigate this further and provide a reliable solution, we kindly request you to share a simple reproducible sample project that demonstrates the issue. This will help us:
- Analyze the exact behavior with your current setup.
- Identify if any additional assemblies are being trimmed by the linker.
- Suggest a precise workaround or configuration tailored to your scenario.
Please include the following in your sample:
- Your .csproj file with current linker settings.
- Any relevant code related to the HTTPS call that fails.
Once we receive the sample, we’ll promptly investigate and get back to you with a resolution.
Thank you for your continued patience and cooperation.
Regards,
Kishore J
I look forward to seeing this matter resolved successfully.
Hi Carlson,
We are currently validating the reported issue with the provided configuration. Our team is analyzing the behavior to identify the root cause and confirm a reliable resolution.
We will provide
further updates as soon as a fix becomes
available.
Regards,
Kishore J
Hi Carlson,
As per the official .NET MAUI documentation on Linking a .NET MAUI iOS app:
Linking a .NET MAUI iOS app - .NET MAUI | Microsoft Learn
- The .NET for iOS linker is used to remove unused code from your application to reduce its size.
- The recommended configuration is:
- Debug builds:
|
<MtouchLink>None</MtouchLink> |
This disables linking, ensuring that no code is trimmed during development and debugging.
- Release builds:
|
<MtouchLink>SdkOnly</MtouchLink> |
This links only the SDK assemblies, removing unused framework code while preserving your application code. This helps optimize the app size for production.
Using SdkOnly in Release mode is the best practice for balancing app size optimization and runtime stability, while None in Debug mode ensures smooth development without linker-related issues.
Please feel free to reach out if you have any further questions.
Regards,
Kishore J
- 12 Replies
- 6 Participants
-
SM Simon Maystre
- Aug 28, 2025 09:35 AM UTC
- Nov 28, 2025 02:11 PM UTC