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

Free Support Forum - aspose.com

Registering license in a web service

Hi support,


How a Aspose.Cells license can be registered in a web service? I am designing this service using c# .NET

Hi,

Thanks for your posting and considering Aspose.Cells.

You can set the license of the Aspose.Cells using either the file path or stream. If you want to use file path, then you will have to specify the license file path or if you placed the license where Aspose.Cells is located, then you can only use the license name.

For example, the following code is setting the license with its file path, here the license is placed inside the c:\mydir folder

C#


Aspose.Cells.License lic = new Aspose.Cells.License();

lic.SetLicense(“c:\mydir\Aspose.Total.lic”);


If you do not specify the full license path like the following, then Aspose.Cells will search license in the current working directory or in the directory where Aspose.Cells dll is present.

C#
Aspose.Cells.License lic = new Aspose.Cells.License();
//will search license in the current working directory or where Aspose.Cells dll is present
lic.SetLicense("Aspose.Total.lic");

You need to set license only once per application. So please set it inside the webservice global or application level event which is called only once when the application starts.

Please also see the following documentation article for your reference.

( http://www.aspose.com/docs/display/cellsnet/Licensing )

Do you have any option to register license registration call back function instead of actual registration.
We are looking for ways to optimize our start time and license registration takes about 250 ml seconds.
But we not necessary use it right away. The problem is that we use your library around our system, so we don’t know exact place to do registration.

@mathsru,

Thanks for your query.

As mentioned earlier that you do not need to register license every time you use the library but it shall be registered once only throughout the life of the program. So it seems that one time registration is sufficient and overhead can be managed. I am afraid that no callback function is available for registration and you need to use the existing option to register the license.

If it does not fulfill your requirement, please explain your scenario in detail where you want to register license multiple times (which is not required/recommended) along with a running sample application which can be used to observe this scenario and provide our feedback.