Free Support Forum - aspose.com

Issue with Aspose.Note license application

Hi Aspose team,

we are seeing frequent issues related to application of Aspose.Note license. We use Aspose.Total license file that is up to date and works fine for every single Aspose library we use in the same solution (9 Aspose dll’s in total) - however for Aspose.Note it throws following exception:

ERROR Cannot apply license for Aspose.Note based on license file at path ***\Licences\Aspose.Total.lic. See inner exception for further details.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.InvalidOperationException: The license has expired.
at .(Object )
at . ( , )
at .()
at . (Boolean )
at .(Object )
at .()
at .(Object , UInt32 )
at . (Boolean )
at . ()
at .(Object[] , Type[] , Type[] , Object[] )
at .(Stream , Int32 , Object[] , Type[] , Type[] , Object[] )
at .(Int32 , Type[] , Type[] , Boolean )
at . ( , )
at .()
at . (Boolean )
at .(Object )
at .()
at .(Object , UInt32 )
at . (Boolean )
at . ()
at .(Object[] , Type[] , Type[] , Object[] )
at .(Stream , String , Object[] , Type[] , Type[] , Object[] )
at .(Stream , String , Object[] )
at .(Stream , String , Object[] )
at Aspose.Note.License.SetLicense(Stream stream)

The license version is 3.0, Aspose.Note 20.7 (previously 19.3 - with the same issue), license is up to date and works fine for products like Words, Cells etc. Could you please take a look?

Thanks,
Mateusz

@acturisaspose,

We need a runnable sample application to reproduce the issue on our end, so kindly create one such VS.NET application, zip the project and attach here. Please do not include your license file in the solution. Also, you may skip including Aspose Dlls to minimize the size of the application, we will check it soon.

Hi,

please find the sample attached.

AsposeNoteSlowLoad.zip (4.8 KB)

Thanks,
Mateusz

@acturisaspose,
This project does not contain folder InputFile and the sample file ‘Quick Notes.one’. I tried this code using own Aspose.Total.Product.Family.lic and a sample .one file. No issue is produced and all the iterations are completed without any exception. Could you please share your sample .one file for our testing here?

Hi,

sorry for the confusion, I’ve not cleaned up the solution properly from the previous example. The file is not needed, also the Program class can be simplified to just:

class Program
    {
        static async Task Main(string[] args)
        {
            Console.WriteLine("Starting");
            Task.Run(Job);
            Task.Run(Job);
            Task.Run(Job);
            await Task.Run(Job);
            Console.WriteLine("Completed");
            Console.ReadKey();

        }

        private static void Job()
        {
            
            for (int i = 0; i < 100; i++)
            {
                var licenseApplier = new LicenseApplier();
                licenseApplier.ApplyLicense(1000);
            }
        }
    }

For me it throws 100% of times using attached code with Aspose.Note v20.7. Please let me know if you still cannot replicate - I’ll attach full solution with dll files to check. Can this be caused by license file? Should I give you some license details so you can check on similar file on your side?

Thanks,
Mateusz

@acturisaspose,
We are afraid that after changing code according to your suggestions we are still not able to reproduce the issue as shown in the attached video. You may please share a clean runnable sample project which can be used to reproduce the issue. Your license is also required so you may send license via private message.
NOTE_219422.mp4.zip (753.8 KB)