ambiguous methods or properties Syncfusion.Blazor.SyncfusionBlazor.AddSyncfusionBlazor

Has anybody had this issue and know how to solve it - Program.cs file? 

Severity    Code    Description    Project    File    Line    Suppression State
Error (active)    CS0121    The call is ambiguous between the following methods or properties: 'Syncfusion.Blazor.SyncfusionBlazor.AddSyncfusionBlazor(Microsoft.Extensions.DependencyInjection.IServiceCollection, System.Action<Syncfusion.Blazor.GlobalOptions>)' and 'Syncfusion.Blazor.SyncfusionBlazor.AddSyncfusionBlazor(Microsoft.Extensions.DependencyInjection.IServiceCollection, System.Action<Syncfusion.Blazor.GlobalOptions>)'    RFSC    E:\RFSC\Program.cs    10    


3 Replies

AV Athiswaran Veerasekaran Syncfusion Team May 20, 2025 12:44 PM UTC

Hi Dan Slaby,

Greetings from Syncfusion Support!

This compile-time error occurs due to an ambiguous call between AddSyncfusionBlazor methods when both the Syncfusion.Blazor NuGet package and individual component packages (such as Syncfusion.Blazor.SfPdfViewer,Syncfusion.Blazor.WordProcessor) are installed in the same project.

This usually happens when both the Syncfusion.Blazor package and one or more individual component packages (like Syncfusion.Blazor.SfPdfViewer) are installed in the same project.  To resolve this, use only the individual component packages or the Syncfusion.Blazor meta package—not both.

For more details, refer to the official guide: How to troubleshoot server & client exceptions in Blazor | Syncfusion


Regards,
Athiswaran V



DS DAN SLABY May 20, 2025 03:22 PM UTC

Thanks, I did figure it out. However, when I switched to individual component packages, much of my app functionality was lost (buttons don't work, etc) and I'm trying to figure out why. I think it is in Program.cs where substituting Syncfusion.Blazor.Core for Syncfusion.Blazor results in errors. Adding the reference to Syncfusion.Blazor removes errors, but I haven't reinstalled the Syncfusion.Blazor package. Thanks for the reference as Cursor and Copilot create more errors than solutions when going deeper than immediate (local) code review. Dan




AV Athiswaran Veerasekaran Syncfusion Team May 21, 2025 01:12 PM UTC

Hi Dan Slaby,

Thank you for the update—it's great to hear that you've been able to resolve the issue.

Regarding your observation, you're absolutely correct. When using individual Syncfusion component packages, it's essential to ensure that the necessary services are registered properly. Specifically, in the Program.cs file, the namespace Syncfusion.Blazor should still be used to register Syncfusion services. Substituting it with Syncfusion.Blazor.Core can lead to missing functionality.

If you’d like to review or cross-check your setup, you may find the following documentation helpful for reference:  Button Component - Getting Started

Please feel free to reach out if you have any further questions or need assistance.



Regards,

Athiswaran V


Loader.
Up arrow icon