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

Free Support Forum - aspose.com

Setting a License in Aspose.BarCode takes too long

I set license in Aspose.BarCode will take 700ms. codes are below,

var licPath = @“C:\projects\Aspose.lic”;
Stopwatch stopWatch = new Stopwatch();
var barcodeLic = new Aspose.BarCode.License();
// Get the elapsed time as a TimeSpan value.
TimeSpan ts = stopWatch.Elapsed;

windows 10, ram 8g , i7, 256 ssd

barcodeSetLic.png (4.1 KB)


We have executed the sample code shared by you. It took 65 Milliseconds to set the Aspose.BarCode license. Specifications of the machine are:

Core i7, 6700 HQ @ 2.6GHz

We have used the latest version of the Aspose.BarCode APIs for testing.

I use Aspose.BarCode 17.10.0 from nuget .
License type is Aspose.Total for .NET.
I remove other Aspose components(Words, PDF).
It spend about 500ms ~ 600ms.

Core i7-4500U @ 1.80GHz 2.40GHz
Win10 x64

Thanks for your help.


We have almost the same configurations that are:

Core i7, 6700 HQ @ 2.6GHz
64 bit Windows 10
License: Aspose.Total

Please forward us a sample project demonstrating the issue. We will evaluate it and update you about our findings.

The attach file is my testing project wordTest.zip (2.2 MB)

Thanks for your help


Thank you for sharing sample project. We have executed the sample project. It took 162 Milliseconds. Screenshot of the output screen is attached for your reference.
barcode_time_test.jpg (92.2 KB)

I have a question.
Why do we get different results (65ms vs 162ms) with my project and your original project in your computer ?
I thank codes are the same.


Yes, you are right. The codes are same the only difference is that i took out the statement creating barcode instance out of the start & stop method calls. Build the project and executed the .exe from bin/release folder.

Is there the best way to set license ?


There are two methods to set license:

  • By using string path
  • By using Stream.

From performance point of view they are almost equal. However, an investigation ticket has been created in our system with ID BARCODENET-36722 for further investigation by our Product team. We will update you here once there is some information or a fix version available in this regard.

Thanks for your help


The issue (BARCODENET-36722) has been resolved. Please download the latest version of Aspose.BarCode for .NET and try it at your end.

1 Like

Thanks , it spend about 250 ~ 350 ms.

I want code , how to get license file to mvc app


Code to set the license in MVC application will look like as below. Assuming that the license file is in “App_Data” folder.


    private void SetAsposeLicense(IHostingEnvironment env)
        string basedir = env.ContentRootPath;
        string licPath = Path.Combine(basedir, "App_Data", "Aspose.BarCode.lic");
        Aspose.BarCode.License lic = new Aspose.BarCode.License();

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan