Net 9 Constructor Injection Failing

Hi all,

With the recent Net 9 update coming out, we upgraded our project to the newest version of Net 9 and are having issues using Syncfusion and the new constructor injection for Blazor code-behind files.

Net 9 brought in the new feature of using constructor injection in Razor code-behind files as noted here in Microsoft's documentation

I am attaching two projects, one with a default Net 9 project but with an added constructor injection Razor code-behind file (Home.razor.cs) and the same project with Syncfusion added using the SfDialogService (same file). The first project shows that constructor injection works and the second shows the error you get when you add the Syncfusion package and try to use constructor injection.

Also attached is the unhandled error that I get in the console after adding Syncfusion and trying constructor injection. The error deals with a parameterless constructor but as seen in the first project, it is not needed anymore with Net 9, leading me to believe there are some incompatibilities with Net 9 constructor injection and Syncfusion.

Is this something that you are all already aware of and fixing? Is there any workarounds that you know of?

Thank you,

Ignacio Amezcua 


5 Replies

IA Ignacio Amezcua December 17, 2024 11:50 PM UTC

Attachment


Attachment: SyncfusionNet9_a97390f1.zip


AK Arun Kumar Ragu Syncfusion Team December 19, 2024 05:12 PM UTC

Hi Ignacio Amezcua,


We have resolved the issue and provided a custom patch with the changes below. However, we still need to validate further as the modifications were made at the initial step of initialization of our component. If any additional changes are required, we will share them with you. Otherwise, we will perform complete testing and include this fix in our upcoming volume release. In the meantime, you can use this custom patch. If you face any issues, please let us know.

 

Custom Patch Link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/CustomPatch-1418783069  


Additionally, we have logged the bug feedback for better follow-up. You can comment in that if you have any concerns/queries.

Feedback link : https://www.syncfusion.com/feedback/64153/need-to-provide-a-constructor-based-dependency-injection-support-while-using


Regards,

Arun Kumar R




EY Elias York January 7, 2025 10:08 AM UTC

Thank you so much for sharing the link.



AK Arun Kumar Ragu Syncfusion Team January 15, 2025 04:44 AM UTC

Hi Elias York,

Thank you for the update. The fix will be included in the upcoming 2025 Volume 1 release, which is scheduled for the third week of March. 

Regards,

Arun Kumar R




AK Arun Kumar Ragu Syncfusion Team March 26, 2025 01:28 PM UTC

Hi Ignacio Amezcua,


Thanks for your patience. We have resolved the 'Constructor based dependency injection when using NET 9' issue in our 2025 Volume 1 Main Release (v29.1.33).

Feedback: https://www.syncfusion.com/feedback/64153/need-to-provide-a-constructor-based-dependency-injection-support-while-using 

Release notes: https://blazor.syncfusion.com/documentation/release-notes/29.1.33?type=all#breaking-changes 

The problem occurred due to changes in .NET 9’s dependency injection mechanism, which affected the way builder.Services.AddSyncfusionBlazor() registered services.

Also, we are glad to announce that our Essential Studio® 2025 Volume 1 Main Release v29.1.33 is rolled out and is available for download under the following link.

Essential Studio® 2025 Volume 1 Main Release v29.1.33 is available for download | Announcements Forums | Syncfusion® 

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Regards,

Arun Kumar R


Loader.
Up arrow icon