We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

SetLicense throw exception

We have license 2020 and 2021 year. But this code throw exception
var li = new Aspose.Pdf.License();
try
{
li.SetLicense(GetAsposeTotalLicStream2021());
}
catch (Exception ex2)
{
string s1 = ex2.ToString();
string s2 = ex2.Message;
sError += s1 + ". " + “\r\n” + s2;
}
Error Aspose.Pdf.License
System.Exception: Exception of type ‘System.Exception’ was thrown.
at #=qLfHdFHpXlKIJJ6WGuOB3qOugQpvAbgugLUvfYTfEC_c=.#=z5UKRhBbiOVmp6KYff36s6bbgSVde(Byte[] #=zPyCRY$rKcydbOwaLitM5Tf6F050v) in Aspose.PDF.dll:token 0x6000143+0x69
at #=qLfHdFHpXlKIJJ6WGuOB3qOugQpvAbgugLUvfYTfEC_c=.#=z0bkzpH8vPrL5xSkbbw7LYL3bTSOT.#=zdv5dTq4mtSTHsMP90_FJ19MrqEJK(#=zr3zJuLVglqd3CdeF2fNLJukwG$Gu #=zi4nI9PYPLlOKg_ylh3lpCrQKoyR3) in Aspose.PDF.dll:token 0x6000147+0x62
at #=qLfHdFHpXlKIJJ6WGuOB3qOugQpvAbgugLUvfYTfEC_c=.#=zjWWxp2LcEkRgLBwr8DiQ5Oo=(String #=zyLfOOWo8vLZgZubjgx2mPjYKX2Gw) in Aspose.PDF.dll:token 0x6000140+0x18f
at #=qLfHdFHpXlKIJJ6WGuOB3qOugQpvAbgugLUvfYTfEC_c=.#=z98vSkdI=(String #=zyLfOOWo8vLZgZubjgx2mPjYKX2Gw) in Aspose.PDF.dll:token 0x600013e+0x0
at #=qZYWE8Kld2eswQ8UXdXhJxEiAaE5pff6ycE4IjeRApOQ=.#=zgSbIOStHsC1VrhBalHtbaPgppiVe.#=zC_hndf0VXvm3oFKfWt6ZDyPY0$_C(String #=zhGnF2xq6mfGhSovQtdrgZkI=) in Aspose.PDF.dll:token 0x600023e+0x0
at #=qZYWE8Kld2eswQ8UXdXhJxEiAaE5pff6ycE4IjeRApOQ=.#=zgSbIOStHsC1VrhBalHtbaPgppiVe.#=zftYGvW3nyotll74bq8ew9_H44qVC() in Aspose.PDF.dll:token 0x600023d+0x20
at #=qZYWE8Kld2eswQ8UXdXhJxEiAaE5pff6ycE4IjeRApOQ=.#=z70ZWqH29_2PdDKhnjSs$VT_qx30O(String #=zFkUjSao=) in Aspose.PDF.dll:token 0x600023a+0x35
at #=qZYWE8Kld2eswQ8UXdXhJxEiAaE5pff6ycE4IjeRApOQ=.#=zIlmmcUuUfghUYIAzfuDKT$UIEBtf(Object #=zDS2hBx02ckQ7l_JKvq87_NgfPE1F, ResolveEventArgs #=zlG_N4VKOdi0mw7pt2GiAQiEsieWM) in Aspose.PDF.dll:token 0x6000239+0x22
at System.Runtime.Loader.AssemblyLoadContext.InvokeResolveEvent(ResolveEventHandler eventHandler, RuntimeAssembly assembly, String name) in System.Private.CoreLib.dll:token 0x6003680+0xa6
at System.Runtime.Loader.AssemblyLoadContext.OnResourceResolve(RuntimeAssembly assembly, String resourceName) in System.Private.CoreLib.dll:token 0x600367d+0x0
at System.Reflection.RuntimeAssembly.GetResource(QCallAssembly assembly, String resourceName, UInt32& length) in System.Private.CoreLib.dll:token 0x6004e6c+0x31
at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name) in System.Private.CoreLib.dll:token 0x6004e6e+0x24
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=zfQcQfzCbVo9Kz6uVkySBHdG4FtLEPU2_Lql__hm3ENMt(Object #=z98vSkdI=) in Aspose.PDF.dll:token 0x600050b+0x0
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=zscApEJl3QBvp79g$zluI8BUfm0b5kZ4SApSRUUI=(MethodBase #=z98vSkdI=, Boolean #=zCYKjnzs=) in Aspose.PDF.dll:token 0x6000523+0x219
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=zYu8sg5Q6vK9aX2Q9Wzwy9ga6rEsX2k8CNVIAd_s=(#=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY= #=z98vSkdI=, #=qn4I72mRO2A6RnW4nnAmo6RlngxYRRgCXU7eGrEC6RJM= #=zCYKjnzs=) in Aspose.PDF.dll:token 0x6000448+0x0
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=zJoMkBfERnZjZIOkK0g==() in Aspose.PDF.dll:token 0x6000505+0x0
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=z55LysC60mxI2D2ple1lW5XFgb4leLS10Fw==(Boolean #=z98vSkdI=) in Aspose.PDF.dll:token 0x600050d+0x62
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=zfQcQfzCbVo9Kz6uVkySBHdG4FtLEPU2_Lql__hm3ENMt(Object #=z98vSkdI=) in Aspose.PDF.dll:token 0x600050b+0x0
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=z8oBKkxDjVXLBXYrt7fQRRAY=() in Aspose.PDF.dll:token 0x60004e0+0xd
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=zEM03Jg8R9RcPxWY9HemmMgok3siOrmGTdgR9lnU=(Object #=z98vSkdI=, UInt32 #=zCYKjnzs=) in Aspose.PDF.dll:token 0x60004bd+0x169
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=z55LysC60mxI2D2ple1lW5XFgb4leLS10Fw==(Boolean #=z98vSkdI=) in Aspose.PDF.dll:token 0x600050d+0x72
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=zVy_XAqy52iRtG4gnSfrZcceJdXX$CmZnFoN69W8=() in Aspose.PDF.dll:token 0x60004e6+0x0
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=zQOsefAvEabeNZUDSUfVAMlpX1BSFlO4_eO7Dv8E=(Object[] #=z98vSkdI=, Type[] #=zCYKjnzs=, Type[] #=zMomoXC0=, Object[] #=zkksRuto=) in Aspose.PDF.dll:token 0x6000525+0xb3
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=zelBBmzIM5OAmcq4pm$FDVI8=(Stream #=z98vSkdI=, String #=zCYKjnzs=, Object[] #=zMomoXC0=, Type[] #=zkksRuto=, Type[] #=zF43UUPI=, Object[] #=zEj6apbg=) in Aspose.PDF.dll:token 0x6000539+0x10
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=z3yni0SeI5QXMd0U26itbEIA=(Stream #=z98vSkdI=, String #=zCYKjnzs=, Object[] #=zMomoXC0=) in Aspose.PDF.dll:token 0x60004ba+0x0
at #=qsUQXwUyaHwW4I7AeCurnx$8GdUlq7vvT28qjVCyY0DY=.#=zAWQ7pm8Mj0qCfFyAu1$yjD0=(Stream #=z98vSkdI=, String #=zCYKjnzs=, Object[] #=zMomoXC0=) in Aspose.PDF.dll:token 0x6000487+0x0
at Aspose.Pdf.License.SetLicense(Stream stream) in Aspose.PDF.dll:token 0x6020193+0x12

@aihtos.r

I request you to please share the license file privately with us by clicking my name icon and using Message option to send privately. Please do notify us here once you have shared the license privately.

int_1.jpg
Здравствуйте,

Отправил файл лицензии в сообщении
https://forum.aspose.com/t/setlicense-throw-exception/232718

I use Net6 preview 6, and VisualStudio2022 17.0.0 preview 2.1

С уважением,
Кайгородов Алексей

Генеральный директор
ООО “Стройформ”
mailto:aleksey.kaygorodov@stroyform.ru
тел: 8(901)530-3145

@aleksey.kaygorodov

I can not reproduce the issue. I request you to share more details like if the license fails sometimes or every time when you set it? Please share a sample application reproducing the issue.

Project.zip (34.1 KB)

Re: [Free Support Forum - aspose.com] [Aspose.PDF Product Family] SetLicense throw exception Throw exception this function: ModuleMacros.ActivateAsposePdf(true);

int_1.jpg
Hi Fayyaz,

Sample in attachments.
Password: 112233

Throw exception this function: ModuleMacros.ActivateAsposePdf(true);

С уважением,
Кайгородов Алексей

Генеральный директор
ООО “Стройформ”
mailto:aleksey.kaygorodov@stroyform.ru
тел: 8(901)530-3145

(Attachment Test.rar is missing)

@aleksey.kaygorodov

Please share the Test.rar file as a zip file because it is missing as attachment. Please minimize the code reproducing the issue.

Test.zip (9.2 KB)

@aihtos.r

We are checking it and will get back to you soon.