Free Support Forum - aspose.com

Licensing Aspose and passing authentication into sub-processes

We’re having issues where Aspose code is hanging on opening and saving specific documents, of types MSG and PDF. We have separate threads on these issues but we’ve had this before and after those specific documents were fixed we then experience the problem on other documents. We can’t afford to keep having an application that hangs when calling Aspose code, so…

We’ve altered our application design to execute Aspose code on sub-processes that we can monitor and make a timeout decision in case the open or save it is taking too long (our current settings are for a timeout of 10 minutes). This has had a drastic effect on our applications performance and one of the key areas where time is lost is during Aspose licensing.

Our application is a .net console app which takes a list of files and converts them to PDF/A. For the conversion and to be able to impose our own timeout we pass each file to a sub-process (which is the same .net console application but with a parameter for the specific file to convert). So we end up in a situation where the main console app starts up and licenses Aspose. It then works through the list and passes file conversions into the sub-process (new ProcessInfo…), which then starts up and again licenses Aspose.

My question is - is there a way we can pass the Aspose license authentication into the sub-process so we don’t need to license again and again?

@Drammy,

There is no other way, because whenever you will use another instance of Aspose.Email or Aspose.PDF or any other API when starting the sub-process you will have to load license file. Moreover, SetLicense() call is not that resource intensive too. If you want to avoid disk operations for reading a license file, you may consider embedding the license into the assembly as an embedded resource.

I suspected this was the case. Yes, we’ve embedded the license as a resource, thanks.