Hi,
When reading in our licence file (as an embedded resource in our VisualStudio 2019 project) into a System.Stream
object and calling SetLicence(stream)
on the Aspose.Imaging.License
, Aspose.Note.License
and Aspose.Slides.License
modules, an AmbiguousMatchException
is thrown.
Dll versions:
- Aspose.Imaging.dll - 19.9.0.0
- Aspose.Note.dll - 19.7.0.0
- Aspose.Slides.dll - 19.8.0.0
(I did download the latest version 22.2.0.0 of Aspose.Imaging.dll and this still caused an exception.)
All our other Aspose modules load successfully.
We are targeting .NET Framework 4.8
This is a code snippet:
`public static void SetModuleLicences(string sLicence)
{
Assembly assembly = Assembly.GetExecutingAssembly();
using (Stream stream = assembly.GetManifestResourceStream(“PDFPrintManager.Resources.” + sLicence))
{
stream.Seek(0, SeekOrigin.Begin);
Aspose.ThreeD.License license3D = new Aspose.ThreeD.License();
license3D.SetLicense(stream);
stream.Seek(0, SeekOrigin.Begin);
Aspose.BarCode.License licenseBarCode = new Aspose.BarCode.License();
licenseBarCode.SetLicense(stream);
stream.Seek(0, SeekOrigin.Begin);
Aspose.Cells.License licenseCells = new Aspose.Cells.License();
licenseCells.SetLicense(stream);
stream.Seek(0, SeekOrigin.Begin);
Aspose.Cells.GridDesktop.License licenseCellsGridDesktop = new Aspose.Cells.GridDesktop.License();
licenseCellsGridDesktop.SetLicense(stream);
stream.Seek(0, SeekOrigin.Begin);
Aspose.Diagram.License licenseDiagram = new Aspose.Diagram.License();
licenseDiagram.SetLicense(stream);
stream.Seek(0, SeekOrigin.Begin);
Aspose.Email.License licenseEmail = new Aspose.Email.License();
licenseEmail.SetLicense(stream);
stream.Seek(0, SeekOrigin.Begin);
Aspose.Imaging.License licenseImaging = new Aspose.Imaging.License();
licenseImaging.SetLicense(stream);
stream.Seek(0, SeekOrigin.Begin);
Aspose.Note.License licenseNote = new Aspose.Note.License();
licenseNote.SetLicense(stream);
stream.Seek(0, SeekOrigin.Begin);
Aspose.OCR.License licenseOCR = new Aspose.OCR.License();
licenseOCR.SetLicense(stream);
stream.Seek(0, SeekOrigin.Begin);
Aspose.Pdf.License licensePdf = new Aspose.Pdf.License();
licensePdf.SetLicense(stream);
stream.Seek(0, SeekOrigin.Begin);
Aspose.Slides.License licenseSlides = new Aspose.Slides.License();
licenseSlides.SetLicense(stream);
stream.Seek(0, SeekOrigin.Begin);
Aspose.Tasks.License licenseTasks = new Aspose.Tasks.License();
licenseTasks.SetLicense(stream);
stream.Seek(0, SeekOrigin.Begin);
Aspose.Words.License licenseWords = new Aspose.Words.License();
licenseWords.SetLicense(stream);
}
}`
The exception stack trace is (which won’t be of much help I don’t suppose):
`System.Reflection.AmbiguousMatchException
HResult=0x8000211D
Message=Ambiguous match found.
Source=mscorlib
StackTrace:
at System.DefaultBinder.SelectMethod(BindingFlags bindingAttr, MethodBase[] match, Type[] types, ParameterModifier[] modifiers)
This exception was originally thrown at this call stack:
System.DefaultBinder.SelectMethod(System.Reflection.BindingFlags, System.Reflection.MethodBase[], System.Type[], System.Reflection.ParameterModifier[])`