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

Free Support Forum - aspose.com

Windows Service Won't Start with Latest Version

I installed the latest version of Aspose.Words and successfully tested it using a Windows console application. Testing with a Windows service, which is how we use it in production, results in the service not starting, producing this error message:


Windows could not start the ProcessDocumentsService service on Local Computer.
Error 1053: The service did not respond to the start or control request in a timely fashion.

If I revert back to a previous version the service starts immediately.

I examined the Windows event log and found this information that seems to point to a license problem:

Application: ProcessDocumentsService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
Stack:
at x28925c9b27b37a46.x220f433da4115056.x7d0214bf69711dd9(System.IO.Stream)
at x28925c9b27b37a46.x220f433da4115056.x7d0214bf69711dd9(System.String, System.Reflection.Assembly)
at Aspose.Words.License.SetLicense(System.String)
at ProcessDocumentsService.Program.Main()

Has something changed in this version that requires different code for handle the license?

Hi Mike,

Thanks for your query. It would be great, If you share information about window service process. Please share your console application code so that we can investigate this issue at our end.

It would be an awful lot of code for someone to dig through.


I just looked at the console app and the code for the Aspose.Words license is commented, so now I’m really puzzled. Obviously there’s a good reason for it since it works without that code, but it did surprise me. It’s been a couple of years since we started using Apose.Words so I remember little about the initial setup.

Here’s the relevant code in the service:

using System.Collections.Generic;
using System.ServiceProcess;
using System.Text;
// Aspose
using Aspose.Words;

namespace ProcessDocumentsService
{
static class Program
{
///
/// The main entry point for the application.
///
static void Main()
{
Aspose.Words.License l = new Aspose.Words.License();
l.SetLicense(@“Aspose.Words.lic”);

ServiceBase[] ServicesToRun;

// More than one user Service may run within the same process. To add
// another service to this process, change the following line to
// create a second service object. For example,
//
// ServicesToRun = new ServiceBase[] {new Service1(), new MySecondUserService()};
//
ServicesToRun = new ServiceBase[] { new Service1() };

ServiceBase.Run(ServicesToRun);
}
}
}

As I stated in my original post, it works fine if I revert back to our previous version - 9.7.

Do we need a new license file? Ours contains the following line:


20110318

Though I don’t know why it would work with version 9.7 but not with 10.8 if the file needed to be updated.

Now I’m really confused. I took the code that sets the license out of the service, compiled it and executed it with version 10.8, and it worked fine. Why do I not seem to need the SetLicense command?

Hi Mike,

Thank you for inquiry. Every Aspose license carries one-year subscription for free upgrades to new versions released during this time. So, you can see the expiration date of your license and use any version of Aspose.Words published before this date.

<o:p> </o:p>

20110318

<o:p> </o:p>

It means that you can free upgrade to version of Aspose.Words published before 03/18/2011.


Hi Mike,


Moreover, in your case, you need to upgrade your licensing subscription. For more details please view the article below:

License File Not Working Anymore

In case of any ambiguity, please let me know.