Setting License for Aspose.Slides using HTTP Module

Last post 12-15-2010, 7:30 PM by Mudassir. 1 replies.
Sort Posts: Previous Next
  •  12-15-2010, 6:10 AM 273978

    Setting License for Aspose.Slides using HTTP Module .NET

    Hi.

    [Please refer my earlier post http://www.aspose.com/community/forums/thread/258028.aspx]

    In my application, I am using HTTP module to register the License using the following code.

    Aspose.Slides.License license = new Aspose.Slides.License();

    license.SetLicense(httpApp.Context.Server.MapPath("~") + "\\" + licenseName);

    The above piece of code runs for every request to my application by the user. So license is set everytime user hits my application. Manytimes, I am getting NullReferenceException (in the SetLicense call) in the place where the object can't be null at all. Is there any other way to call SetLicense as static method (so that it will be called only once when my application is hit for the very first time)? Will this be a solution to my problem? Please suggest.

     
  •  12-15-2010, 7:30 PM 274113 in reply to 273978

    Re: Setting License for Aspose.Slides using HTTP Module

    Dear Edin,

    As I have shared earlier in the referenced thread that the NullReferenceException is thrown in the place where the object can't be null at all. We feel, the only possible reason is that another thread set it to null. So, at first please try to synchronize SetLicense calls and remove all unnecessary license initializations in case it exists in your code. You may please test the scenario with a single thread call for assurance. We suggest you to try synchronizing your thread calls but first verify the fact in single thread environment.

    Thanks and Regards,


    Mudassir Fayyaz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML