Free Support Forum - aspose.com

Applying license

How do you apply a license to an MVC file?

Apparently adding a reference in the Global.asax file is useless, I am still getting the same error that this is a trial version.

I cannot open any of the other supplied documents other than the demo.docx file. I get a permission denied error when I point to sample.xlsx or candy.pdf.

I am also getting the 15 tries per hour error. What good is your temporary license if none of these features work?

Hi,


Thanks for contacting support.

We do not have any specific instructions related to license initializing to MVC applications and the license initialization remains same in all application types. However, there are some points which need to be considered for license initialization.

The license needs to be initialized before any object of an API is instantiated, as the API performs validation at the same time. Furthermore, it is recommended to place license initialization calls in static method of application i.e. Page Load or application launch and it is not recommended to call the routines again and again. The repetitive calls may cause trouble when loading the license file in Stream instance.

Furthermore, the temporary license provides same set of features as purchased license, so we do not have any limitations. In case you still face the same problem, please share a sample project, so that we can test the scenario in our environment. We are sorry for your inconvenience.

The project code is the one in your download. The MVC front end in your showcases folder.

This is the code in YOUR global.asax file:
private string _licensePath = “D:\Aspose.Total.lic”;
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);

        GroupDocs.Viewer.License lic = new GroupDocs.Viewer.License();
        lic.SetLicense(_licensePath);
    }

The only thing I am changing is the name of the file in the Index.cshtml is the name of the file from demo.docx to candy.pdf which you also provided.

I have the .lic file in the root D: and permission does not seem to be an issue.

So please tell me why this doesn’t work.

Hi,


Thanks for sharing the details.

From above code snippet, it appears that you are using ViewerAPI of GroupDocs but your problem description states conversion feature limitations. Can you please confirm so that we can reply accordingly.