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

Free Support Forum - aspose.com

Aspose Cells License File in Website Resource File

Hi there,

I have a query regarding the best way to embed a license file within a .NET website (rather than a web application). Is there a guide or documentation relating to this task? I've searched the help info, developers docs etc but they don't seem quite accurate.

The guidance to include the file as an embedded resource and then 'In Solution Explorer and set Build Action to Embedded Resource in the Properties window' Within a website this option doesn't exist, so I wondered what the appropriate option should be?

At the moment I have the license file included in a resx, but calling SetLicense("Aspose.Cells.lic"); doesn't find the file (I can confirm that other resources can be found within the resx file, so I'm confident that the resource file is usable and in the correctly named for my project)

Are there any pointers, specifically aimed at a project which is a website, rather than a web application for embedding a license in a resource file?

Kind Regards,



Well, this option “Build Action to Embedded Resource” is not available for Web projects/applications. If you are developing a Windows Forms or Console Application, call licensing code in your startup code, before using Aspose.Cells classes. You can embed your license file as embedded resource.

When developing an ASP.NET or Web application, you can have your license file into your project (you may put into some folder) and call licensing code from the Global.asax.cs (Global.asax.vb) file, e.g in the Application_Start protected event/method. It is called once when the application starts. If you are developing a class library, you can call License.SetLicense from a static constructor of your class that uses Aspose.Cells. The static constructor will execute before an instance of your class is created making sure Aspose.Cells license is properly set.

For further reference, please check:

Thank you.