Using different nuget package depending on OS (Windows/Linux(docker))

Hi,

I'm using Syncfusion.EJ2.PdfViewer.AspNet.Core.Windows|Linux package for creating and manipulating PDFs. When I'm working on my development environment, I'm using Windows. Therefore I would like to use this package:  Syncfusion.EJ2.PdfViewer.AspNet.Core.Windows.

But for the production, I'm creating Linux docker container. Therefore I would like to use:  Syncfusion.EJ2.PdfViewer.AspNet.Core.Linux package. Is there any way I could do this without changing the csproj on my local environment?


1 Reply

DM Dhivyabharathi Mohan Syncfusion Team January 17, 2022 01:19 PM UTC

Hi Matic, 
  
 
 
There is no possibility to install the EJ2 PDF Viewer Linux and Windows package in the same environment without modifying the .csproj file. However, you can install the EJ2 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: 
  
   <PackageReference Include="Syncfusion.EJ2.PdfViewer.AspNet.Core.Linux" Version="19.4.0.42" Condition="$([MSBuild]::IsOsPlatform('Linux'))"/>  
 
    <PackageReference Include="Syncfusion.EJ2.PdfViewer.AspNet.Core.Osx" Version="19.4.0.42" Condition="$([MSBuild]::IsOsPlatform('OSX'))"/>  
 
    <PackageReference Include="Syncfusion.EJ2.PdfViewer.AspNet.Core.Windows" Version="19.4.0.42" Condition="$([MSBuild]::IsOsPlatform('Windows'))"/>  
 
  
  
  
  
 
 
Please revert to us, if you need further assistance. 
 
  
  
 
Regards, 
Dhivya. 


Loader.
Up arrow icon