Unable to Build when add Syncfusion.Blazor.PdfViewerServer.Windows from Nuget

I'm working on a Blazor application with some Syncfusion Component and all works fine.
Now I have to add a Page with a PDF viewer but when I add Syncfusion.Blazor.PdfViewerServer.Windows from Nuget I can't build the Blazor project.

A hundred of error message like this:

Error CS0433:
The type 'SfDialog' exists in both 'Syncfusion.Blazor.Popups, Version=18.4.0.33, Culture=neutral, PublicKeyToken=null' and 'Syncfusion.Blazor, Version=18.4.0.33, Culture=neutral, PublicKeyToken=null'    PL.BlazorUI    C:\Users\.....\PL.BlazorUI\Components\DocImageComp.razor


Error CS0433:
The type 'UploadFiles' exists in both 'Syncfusion.Blazor.Inputs, Version=18.4.0.33, Culture=neutral, PublicKeyToken=null' and 'Syncfusion.Blazor, Version=18.4.0.33, Culture=neutral, PublicKeyToken=null'    PL.BlazorUI    C:\Users\.....\PL.BlazorUI\Services\ApiService.cs


I have installed only Syncfusion.Blazor and Syncfusion.Blazor.PdfViewerServer.Windows from Nuget (v. 18.4.0.33).

I tryed also with a void new solution but I get the same result.

5 Replies 1 reply marked as answer

VS Vasugi Sivajothi Syncfusion Team January 11, 2021 09:30 AM UTC

Hi Andrea, 
 
Thank you for contacting Syncfusion support. 
 
From Volume 4 release (v18.4.0.30), the Syncfusion Blazor UI components are separately available in individual NuGet packages. The NuGet packages are segregated based on the component usage and its namespace. We suggest you use Syncfusion.Blazor.PdfViewerServer.Windows NuGet packages alone for your Blazor Server applications. No need to install Syncfusion.Blazor NuGet packages for PDF Viewer Blazor applications (if you want to use other syncfusion Blazor component please check and install syncfusion Blazor individual NuGet packages). Please find the documentation link from the below link. 
 
Note: Do not use both Syncfusion.Blazor and individual NuGet packages in the same application. It will throw ambiguous errors while compiling the project 
 
Regards, 
Vasugi 


Marked as answer

ML Michael LeClair February 20, 2023 11:59 AM UTC

Hello,


I'm looking to integrate a PDF viewer into my Blazor server application which already has the Syncfusion.Blazor nuget packages (Syncfusion.Blazor & Syncfusion.Pdf.Net.Core).  Is there no way for me to do this?  I have the same issues compiling and you mentioned that we cannot install the viewer in the same app that contains the other packages.  I need the viewer to be part of my main application so what options do I have to accomplish this?


Thank you very much,


Mike LeClair



VV Visvesvar Venkatesan Syncfusion Team February 21, 2023 08:30 AM UTC

Michael,

The Syncfusion Blazor UI components are separately available in individual NuGet packages. The NuGet packages are segregated based on the component usage and its namespace. We suggest you use Syncfusion.Blazor.PdfViewerServer.Windows NuGet package for your Blazor Server applications.

No need to install Syncfusion.Blazor NuGet packages for PDF Viewer Blazor applications (if you want to use other Syncfusion Blazor components please check and install Syncfusion Blazor individual NuGet packages).

Kindly refer to the below-modified sample and revert to us if you have any concerns about it.

Sample Link - https://www.syncfusion.com/downloads/support/directtrac/general/ze/BlazorAppSF_basic_Sample-1878408435.zip

Documentation Link: https://blazor.syncfusion.com/documentation/nuget-packages/#for-blazor-server-application




JO jose replied to Michael LeClair June 19, 2023 05:43 PM UTC

Did you find a solution? Im having the same issue.



CK Chinnamunia Karthik Chinna Thambi Syncfusion Team June 27, 2023 01:15 PM UTC

Sorry, it is not possible to use Syncfusion.Blazor and individual NuGet packages in the same application. It will throw ambiguous errors while compiling the project.

 

We use Syncfusion.Blazor.PdfViewerServer.Windows NuGet package for the ServerApp and Syncfusion.Blazor.PdfViewer for the wasm. The Syncfusion.Blazor has the reference to Syncfusion.Blazor.PdfViewer alone, not the Syncfusion.Blazor.PdfViewerServer.Windows package. Syncfusion.Blazor.PdfViewer will refer to all individual dll’s and Syncfusion.Blazor.PdfViewerServer.Windows will refer to the individual dll's. This will cause a duplication error. So, we suggest you use Syncfusion.Blazor.PdfViewerServer.Windows NuGet packages alone for your Blazor Server applications. If you want to use other Syncfusion Blazor components please check and install Syncfusion Blazor individual NuGet packages. We have shared the documentation for your reference.

 

Documentation Link: https://blazor.syncfusion.com/documentation/nuget-packages/#for-blazor-server-application

 

 Benefits of using individual Nuget Packages:

 

  • While installing Syncfusion.Blazor NuGet package in a Blazor WebAssembly application, it will load the complete Syncfusion Blazor library in the web browser which takes more initial loading time. Whereas, the individual NuGet package installation will resolve this and load the required components assembly alone in the web browser.
  • The Lazy load assemblies in Blazor WebAssembly functionality can be utilized with the Syncfusion Blazor individual NuGet packages.
  • These individual NuGet packages can be used in the Blazor Server application to reduce the application deployment size in production.

 

Note:

 

  • Do not use both Syncfusion.Blazor and Syncfusion.Blazor.PdfViewerServer.Windows packages in the same application. It will throw ambiguous errors while compiling the project. 
  • Do not use both Syncfusion.Blazor and individual NuGet packages in the same application. It will throw ambiguous errors while compiling the project. 

Loader.
Up arrow icon