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?
VVVisvesvar Venkatesan Syncfusion Team October 20, 2022 07:11 AM
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.