We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Issue with having both PdfViewerServer.Windows and PdfViewerServer.Linux installed

Hello,


I have a small problem. We have a team of developers working in Windows on Blazor Server application. The application itself runs on a linux server. I have installed both the PdfViewerServer.Windows and PdfViewerServer.Linux packages.

When both are installed, I get these errors and the PDF viewer does not work

Exception thrown: 'System.DllNotFoundException' in Syncfusion.PdfViewer.AspNet.Core.dll

Exception thrown: 'System.TypeInitializationException' in Syncfusion.PdfViewer.AspNet.Core.dll

However, if I remove the .Linux package the PDF viewer works properly when running on Windows.

Is there any way to have both installed and have the application determine which package to use so it works properly whether its running on linux or windows?

Thanks!


3 Replies

VV Visvesvar Venkatesan Syncfusion Team October 20, 2022 07:11 AM

Hi Matthew,


You can install the Blazor PDF Viewer packages automatically based on the operating system by adding all the PDF Viewer NuGet packages in your .csproj file as like the below code snippet and on building the same it will install the NuGet based on the operating system.


Code Snippet:


<ItemGroup>


    <PackageReference Include="Syncfusion.Blazor.PdfViewerServer.Linux" Version="20.2.0.36" Condition="$([MSBuild]::IsOsPlatform('Linux'))"/>


    <PackageReference Include="Syncfusion.Blazor.PdfViewerServer.Windows" Version="20.2.0.36" Condition="$([MSBuild]::IsOsPlatform('Windows'))"/>


</ItemGroup>



Regards,

Visvesvar K V 



MA Matthew October 21, 2022 10:06 AM

Awesome, thank you!



VV Visvesvar Venkatesan Syncfusion Team October 23, 2022 11:53 PM

Hi Mathew,


Thank you for your update.



Regards,

Visvesvar K V 



Loader.
Live Chat Icon For mobile
Up arrow icon