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

Free Support Forum - aspose.com

SetLicense returns NullReferenceException error

My client just installed a release version of our project onto their production webserver and is receiving the same error as described on this post
https://forum.aspose.com/t/112801

This is the first time we have seen this error. We have tested on development and staging servers without any problems. This post has a link to may help address this problem but I receive an error when accessing it.
WE NEED A SOLUTION URGENTLY SINCE THIS IS ROOLING TO PRODUCTION TODAY/TOMORROW
In our project we set the license in the global.asax

protected void Session_Start(object sender, EventArgs e)
{
Aspose.Words.License li = new Aspose.Words.License();
li.SetLicense(“Aspose.Words.Lic”);
}

The lic file is located in both the bin folder and the application root path. Attached is our lic file.

Below is the exact error returned:

Exception information: 

Exception type: NullReferenceException 

Exception message: Object reference not set to an instance of an object. 

Request information: 

Request URL: XXXXXXXXXXXX/ReturnUrl=/shopfloorworkspace/default.aspx

Request path: /ShopFloorWorkspace/Login.aspx 

User host address: 153.4.156.36 

User: 

Is authenticated: False 

Authentication Type: 

Thread account name: NT AUTHORITY\NETWORK SERVICE 

Thread information: 

Thread ID: 1 

Thread account name: NT AUTHORITY\NETWORK SERVICE 

Is impersonating: False 

Stack trace: at ՞.⬁.⬑(Stream ؟)

at ՞.⬁.⬑(String ⬒, Assembly ⬓)

at Aspose.Words.License.SetLicense(String licenseName)

at ShopFloorWorkspace.Global.Session\_Start(Object sender, EventArgs e)

at System.Web.SessionState.SessionStateModule.RaiseOnStart(EventArgs e)

at System.Web.SessionState.SessionStateModule.CompleteAcquireState()

at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)

at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Hi

Thanks for your request.

  1. I think that you should call SetLicense in Application_Start method as mentioned here.
    https://docs.aspose.com/words/net/licensing/

  2. Have you tried set read/write permissions for “Crypto\RSA\MachineKeys” folder?

  • Make sure there is a directory ‘’’\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys’’’ exists, create it if needed.
  • Make sure ‘‘Everyone’’ has read and write permissions into this directory.

Best regards.