I am attempting to display a pdf file to the users of my Xamarin.Forms Android and iOS applications. I am trying to use the Nuget package Syncfusion.Xamarin.SfPdfViewer.
However, installing the package and recompiling results in the following error:
Error CS0433 The type 'ApplicationException' exists in both 'Syncfusion.Compression.Portable, Version=16.1451.0.37, Culture=neutral, PublicKeyToken=null' and 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'
I have read and heeded the note on the Nuget package:
Note: This package needs to be installed in all Xamarin.Forms projects (PCL, Android, iOS and UWP).
I have searched the web for similar cases such as:
I am using:
Thank you for your help.
Found a workaround. Since good practice is to derive meaningful exceptions from Exception, I created one and used it in place of where I was using ApplicationException. This removed the ambiguity and solution then compiled.
public class ClaimWriterException : Exception
{
public ClaimWriterException()
{
}
public ClaimWriterException(string message)
: base(message)
{
}
public ClaimWriterException(string message, Exception inner)
: base(message, inner)
{
}
}