AddSyncfusionBlazor call is ambiguous error

I followed the examples on this page https://blazor.syncfusion.com/documentation/drop-down-menu/getting-started and I can't compile because this line 

builder.Services.AddSyncfusionBlazor(options => { options.IgnoreScriptIsolation = true; });

gives me this error 

error 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>)'


This is my csproj file

<Project Sdk="Microsoft.NET.Sdk.Web">

  <ItemGroup>
    <ProjectReference Include="..\ClassLibrary\ClassLibrary.csproj" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Syncfusion.Blazor" Version="19.4.0.56" />
    <PackageReference Include="Syncfusion.Blazor.DropDowns" Version="19.4.0.56" />
    <PackageReference Include="Syncfusion.Blazor.SplitButtons" Version="19.4.0.56" />
  </ItemGroup>

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

</Project>


And here is my imports.razor file

@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using scheduleUI
@using scheduleUI.Shared
@using Syncfusion.Blazor
@using Syncfusion.Blazor.SplitButtons







3 Replies

TS Thaneegairaj Sankar Syncfusion Team April 7, 2022 10:56 AM UTC

Hi Dorian,


We have prepared a sample, please find the below link.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/PDFViewerServerNavMenuIssue669279869


Note: We have made changes in IgnoreScriptIsolation, so please refer the below link


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


Regards,

Thaneegairaj S



BA Ben Alexandra January 17, 2024 07:31 PM UTC

I had this issue recently and it was because my project was referencing 

  1. Syncfusion.Blazor
  2. Syncfusion.Blazor.Buttons
  3. Syncfusion.Blazor.Theme

Once I removed Syncfusion.Blazor from the project, it worked fine... Alternately, seems like just having ONLY  Syncfusion.Blazor works, too...




KV Keerthikaran Venkatachalam Syncfusion Team January 18, 2024 03:41 PM UTC

Hi Ben Alexandra,


We have checked the reported query and do not use both Syncfusion.Blazor and individual NuGet packages in the same application. It will throw ambiguous errors while compiling the project. So, we suggest you use Syncfusion.Blazor.Buttons NuGet packages alone for the Button component. If you want to use all our Syncfusion Blazor components, please remove individual NuGet packages and install Syncfusion Blazor NuGet packages. We have shared the documentation for your reference.


UG Link: https://blazor.syncfusion.com/documentation/nuget-packages


Please let us know if you need any further assistance on this.


Regards,

KeerthiKaran K V


Loader.
Up arrow icon