Aspose.Total.lic and VB.NET code conflict

Hello. We won a contract from an incumbent that had an old Aspose.Total.lic expired back in December 2013 and that used this code snippet in the ASP.NET file glogal.asax to bypass the expired lincense:

Dim license As Aspose.Cells.License = New Aspose.Cells.License()
'Pass only the name of the license file embedded in the assembly
' DISABLE ASPOSE LICENSE FILE UNTIL REPLACED: license.SetLicense("Aspose.Total.lic")

and then they installed a temporary license file that expired in January 2014. We took over and purchased a new license and want to install it but we are not certain if we should change the global.asax.vb file and recompile the site or we should just drop the new Aspose.Total.lic file in the same directory as tha Aspose.Cells.DLL? Will both methods work or will the global.asax.vb conflict with the Aspose.Cells.DLL method?

Hi Jessie,

Thanks for using Aspose.Cells.

If you have purchased Aspose.Total license (i.e Aspose.Total.lic), it will also work fine with Aspose.Cells. In order to get rid of evaluation warning, you need to set license using the License.SetLicense() method.

This method (License.SetLicense()) takes either the stream or file path as argument. So, if you have placed license for example in C:\myDir and your license name is Aspose.Total.lic, then your license path will be this C:\myDir\Aspose.Total.lic and you will then set it like this

VB.NET


Dim license As Aspose.Cells.License = New Aspose.Cells.License()

license.SetLicense(“C:\myDir\Aspose.Total.lic”)

If your license path does not change, then you do not need to recompile your application. However, if it changes, then you will have to recompile it to make the changes effect.

However, if you do not specify the path and set license like this

VB.NET
Dim license As Aspose.Cells.License = New Aspose.Cells.License()
license.SetLicense("C:\myDir\Aspose.Total.lic")


Then Aspose.Cells will search for license file in the current working directory. The current working directory is usually a Bin directory in case of console/winform application and a virtual directory in case of web application.