System.Exception: Conversion failed -Showing a modal dialog box ....

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Converter for .NET (v1)  /  Re: System.Exception: Conversion failed -Showing a modal dialog box ....

DynamicPDF Converter for .NET (v1) Forum

Platform;

 CeTe PDFConverter 1.0.0 15001 x64
 Windows Server Standard 2007, SP1 (64-bit)
 CeTe Service is running with interact with desktop enabled
 
 When trying to convert a simple DOCX-word file, we are getting the following error;

System.Exception: System.Exception: Conversion failed ---> System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at System.Windows.Forms.Form.ShowDialog()
   at co.b(String A_0, String A_1)
   at b9.a(l A_0, l A_1)
   --- End of inner exception stack trace ---
   at ceTe.DynamicPDF.Conversion.Converter.Convert(ConversionOptions conversionOptions)
   at cr.b.b()
   at cr.a(Byte[] A_0)
   at cr.a(Object A_0) ---> System.Exception: System.Exception: Conversion failed ---> System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at System.Windows.Forms.Form.ShowDialog()
   at co.b(String A_0, String A_1)
   at b9.a(l A_0, l A_1)
   --- End of inner exception stack trace ---
   at ceTe.DynamicPDF.Conversion.Converter.Convert(ConversionOptions conversionOptions)
   at cr.b.b()
   at cr.a(Byte[] A_0)
   at cr.a(Object A_0)
   at by.a(Object A_0)
   --- End of inner exception stack trace ---


 Using NTFilemon, we can see the docx file being read, and the the DLL C:\Program Files (x86)\ceTe Software\DynamicPDF Converter v1.0.0 for .NET\Service\DpdfHProxy.dll being loaded.

 Any ideas?
Posted by a ceTe Software moderator
Hello,

This is a known error and this occurs when the "Interact with Desktop" option is not enabled to the service, or the service is running in an account where this option is not available. Please make sure that the Converter service is running under system account and this option is enabled. You can refer to the Error Guide for this error.

Thanks,
ceTe Software Support Team.
As I wrote in my original post;

 CeTe Service is running with interact with desktop enabled.

 The stacktrace is also different from the stacktrace of another post where interact with desktop was the problem.

 Are there policies or other 'areas' that may stop a service from interacting with the desktop - even though the interact with desktop checkbox is enabled (and service restarted/server restarted)?

 Thanks.
Posted by a ceTe Software moderator
Hello,

Are you getting this error for any type of file or only for .docx file types? Can you please try using the other file types .html, .txt/.rtf and see if it works for you?

Can you please uninstall the product and try installing the latest 64bit edition product downloading from our CustomerArea by logging in using your current serial number, if you are using the 64bit machine? If you are evaluating then you can get it from our website.

Can you please let us know what operating system you are using? Is it Windows 2008 SP1 64 bit? You can check this in system properties. Also please send over the sample code and the files which you are using to our support Support Team so that they can look into it further.

Thanks,
ceTe Software Support Team.
Updating the software did not help. Sorry for not entering the correct server version - we are running Windows Server Standard, 2007, SP1 - 64 bit.

I had the time to sit down with this. It turns out that setting the 'Interact with desktop' setting in service control manager, will still not always allow the service to interact with the desktop. The following error in the event log (System) when starting the CeTe service lead me to the solution:

"The DynamicPDF Converter service is marked as an interactive service.  However, the system is configured to not allow interactive services.  This service may not function properly."

It turns out that some systems are setup with a registry setting to disallow services to interact with the desktop all together. This can be modified by updating the registry:

Under:
  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows

Set "NoInteractiveServices" to 0 (it was 1 in our case)

Then restart the service, and the conversion started to work for us.

Hope this may help others.

Cheers, Thies.
Posted by a ceTe Software moderator
Thanks for the update.  We will keep this in mind.  Glad you got it sorted out.

Thanks,
ceTe Software Support Team
Hi,

I'm getting the same problem with our web application and have tried the above solutions without any luck. We are running the following configurations:

- Win 2008 R2 Standard Server
- 64 bit
- .NET VS2008
- Installed .NET Converter Build 16128x64

I was trialling the build version 15911x64 on the same box and that worked fine. Paid for the production license today, uninstalled the trial version and installed this 16128 built and no luck.

Converter Error:

System.Exception: Conversion failed ---> System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at System.Windows.Forms.Form.ShowDialog()
   at b.b(String A_0, String A_1)
   at bc.b(ac A_0, ac A_1)
   --- End of inner exception stack trace ---
   at ceTe.DynamicPDF.Conversion.Converter.Convert(ConversionOptions conversionOptions)
   at ceTe.DynamicPDF.Conversion.Program.a.b()
   at ceTe.DynamicPDF.Conversion.Program.a(Byte[] A_0)
   at ceTe.DynamicPDF.Conversion.Program.a(Object A_0)

Thanks & regards

Tai Vu
Bluescope Steel
Did you get the "The DynamicPDF Converter service is marked as an interactive service.  However, the system is configured to not allow interactive services.  This service may not function properly" error message in the event log of your system? If yes then the registry setting must be set, and the system rebooted for it to take effect.

Cheers,
  Thies
Hi Thies,

I checked the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows
and this was already set to 0. Rebooted but still not working.
Same error.

Regards

Tai Vu
 
What error do you see in the application event log of your system. Could you also check the spelling of the registry key?
Posted by a ceTe Software moderator
Hello Tai Vu,

After installing the latest build product, have you checked the check box to allow the service to interact with desktop? You will have to check the check box saying "Allow Service to interact with desktop" in the service properties. After this if you are still seeing the error then you may have to try the registry entry solution.

Also can you please give us the details you are seeing in the event log, this will help us to troubleshoot the issue.

Thanks,
ceTe Software Support Team.
Hi,

Below are the errors in the System logs relating to DynamicPDF.

Error 1:
Source: Service Control Manager
EventID: 7030

"The DynamicPDF Converter service is marked as an interactive service.  However, the system is configured to not allow interactive services.  This service may not function properly."

Error 2:
Source: TerminalServices-Printers
EventID: 1111

"Driver DynamicPDF Converter Driver required for printer DynamicPDF Converter is unknown. Contact the administrator to install the driver before you log in again."

The option "Allow service to interact with desktop" in the Log on tab of the DynamicPDF service has always been checked. It's checked by default by the installer.

The registry key

HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\CONTROL\WINDOWS\NoInteractiveServices is already set to 0.

The proposed solution in the earlier threads obviously worked for one of the previous posters but its not working for me. Don't think he/she was using version 16128.

Are there any other registry settings apart from the above i should be looking into? Are there any logs within the DynamicPDF application that could be of any use?

Regards

Tai Vu


 

Posted by a ceTe Software moderator
Hello Tai Vu,

Can you please stop and disable the service named “Interactive Services Detection” in the system and reinstall the Converter product after uninstalling it? Please let us know if this solves the problem.

Thanks,
ceTe Software Support Team.
This service “Interactive Services Detection” had already been stopped and marked as Disabled. Anyhow i uninstalled the software, rebooted, re-installed & rebooted.

Tried running the Converter with the “Interactive Services Detection” service on stopped or started state and still it doesn't work.

In Windows Task manager/Processes, the service is running as 'cete.DynamicPDF.Converter.Service.exe * 32'. Is this a 32 bit exe? But i downloaded & installed the DynamicPDFConverterv100forNETBuild16128x64.msi.

Regards

Tai Vu
Posted by a ceTe Software moderator
Hello Tai Vu,

Can you please send an email to our Support Team so that we can have one of our developers look into your issue and work with you?

The Converter service is basically 32bit and you will see 32 with the service name in task manager. This is not a problem and will not cause any trouble.

Thanks,
ceTe Software Support Team.
I also get the same error as a same server specification.
Any body find the solution.
Posted by a ceTe Software moderator
Hello,

The error “System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application” happens when the Converter Service is not set to “Allow Service to interact with Desktop”. This checkbox is found in the service properties and un-checking this will cause the above exception. For Converter work properly “Allow Service to interact with Desktop” has to be enabled all the time.

Thanks,
ceTe Software Support Team.
Have there been any reports of this error still occurring when the option is checked with Windows 8?

We are getting the error but only under Windows 8.

Andrew
Posted by a ceTe Software moderator
Hello,

No, we have not seen this error recently in the newer builds of DynamicPDF Converter. On your Win 8 machines, please check the following registry entry and make sure that it is set to 0. Restart the DynamicPDF Converter service after making this registry entry change and see if that resolves the issue.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows\NoInteractiveServices

Thanks,
ceTe Software Support Team.
Hi...when you say newer builds, which versions are you referring to?

We are currently working with Build 28350.

Thanks
Posted by a ceTe Software moderator
Hello,

We are referring to the latest v1.0.1.30555 build available for download on our website. You can download the latest build by logging into the customer area using your product serial number. If you are evaluating the product then the latest build can be downloaded here.

Please refer to the operating system requirements and limitations of DynamicPDF Converter product here.

Thanks,
ceTe Software Support Team.
Hi again...

We were able to get the Image generated when InteractiveServices was set to zero on our English workstations.

However, we have some clients on a French (Canadian) version of Windows. When we attempt to use this, it doesn't report an error - it simply freezes the software.

Again, this is only with Windows 10 and Windows 8. On English workstations, the fix above works fine.

Any ideas?

Andrew
Posted by a ceTe Software moderator
Hello,

Please email the following details to support@cete.com so we can look into it further.

1. What file types you are trying to convert?
2. Are you able to convert a simple text file to PDF?
3. Code sample that uses static data to recreate the behaviour.
4. Sample input/source file used for conversion.
5. OS Details: Name, version, x86 or x64.
6. Enable logging by following the below steps and send over the event log file:
        a. Open the ceTe.DynamicPDF.Converter.Service.exe.config file located at C:\Program Files\ceTe Software\DynamicPDF Converter v1.0.1 for .NET\Service\ in notepad.
        b. Edit the enableLogging property and set to "true" and save the file.
                < ceTe.dynamicPdf.conversion tempFilesPath="%WINDIR%\TEMP" conversionsPerProcess="1" printHtmlBackgroundColorAndImage="true" enableLogging="true" / >
        c. Restart the DynamicPDF Converter Service.
        d. Run your application for conversion. Wait a few minutes for the conversion to take place. Let us know if it successfully generated the PDF or if the process is running endlessly.
        e. Converter log files will be created in system event viewer and send them back to us. Below are the steps to retrieve the event logs.
                1. Open Administrator Tools > Event Viewer on the server.
                2. Select Windows Logs > Application
                3. Select all the events that indicate “DynamicPDF Converter” in the source column.
                4. Go to Action menu and select “Save Selected Events” to save the selected logs into a .evtx file.

Thanks,
ceTe Software Support Team.

We are creating a single PDF made up of multiple sources., including Word,  Excel and other PDF files. These all work perfectly fine.

We receive the error when trying convert JPG and PNG to PDF. Image files work fine on English workstations and Windows 7.
Windows 10 and 8 - French Windows installation.

We turned the logging on. The only event in the Windows viewer was one saying that the Converter had loaded successfully (upon reboot)

The process appears to run endlessly. The log file placed in Windows\Temp contains the following:

DynamicPDF Converter Log file.
Log created on : 2018-mars-09 09:54:47

Operating system version :Microsoft Windows NT 6.2.9200.0
Platform :x86
Service Pack :

IE Version :9.11.14393.0
CLR Version :2.0.50727.8766
Meachine Name :DH017295
636561860875256250        Form Service        Started intializing run method
636561860878850377        Form Service        Completed setting up intial params... Entering for client lookups..

Posted by a ceTe Software moderator
Hello,

Based on the details you provided, you seems to be running an older build of Converter. For the latest build v1.0.1.33698 the logs are written to the event log instead of the text file. Please try the latest build on one of the Win 10 machines with the French installation and let us know if the issue still happens.

The latest build can be downloaded from the customer area and the requirements for the new build are listed here.


Thanks,
ceTe Software Support Team.
Hi!

I installed the new version downloaded from the site. We removed and reinstalled the new version but are running into the same thing - the system seems to process everything but the images (I even just tried it with a small JPG file) and then it hangs. I know it processes everything else because if I don't include the JPG, it works fine.

Again, this is ONLY on the French workstations. The English ones work fine.

While I turned on logging, and you had noted that it should be occurring in the Event Viewer only, I still received the following entry in the text file in the TEMP folder:
DynamicPDF Converter Log file.
Log created on : 2018-mars-14 08:51:16

Operating system version :Microsoft Windows NT 6.2.9200.0
Platform :x86
Service Pack :

IE Version :9.11.14393.0
CLR Version :2.0.50727.8766
Meachine Name :DH017295


The dates on the files I was running with are all from 2017 and the installer used explicitly stated version 33698.

When I ran it, in the event viewer, here are the times:
- Le server a demarre avec succes (service started properly) ---- 12:25:34.2162222
- Form Service - Started initializing run method. ------ 12:25:34.216222222
-Form Service - Completed setting up intial params...Entering for client lookups.... 12:25:34.997557

Then I would stop and reboot after 5 minutes so then we get
-Preparing to stop service -12:42:39.013333
-Le service s'est arrete avec success: 12:42:39.044585800
-From service - aborted all managed threads. Stopping service - 12:49:39.044585800


I tried it again and had the same results.
I then restarted the machine:
Demarre avec success: 12:51:16.41432
Form ServiceStarted intializing run method --- 12:51:16.41432
Form ServiceCompleted setting up intial parms ... Entering for client lookups... --- 12:51:16.429957

and then it would die again

Note the difference between the messages in spelling : it goes from "Form service" to "From service" - in case that helps anything.

During each run, a folder is created in the Temp folder with a copy of the JPG file in it.
When I would run with two images, it would stop on the very first one.

If I ONLY choose to do a JPG file, there is nothing stored in the logs at all.

The code in all cases is simply

DynamicPDFConverter.Conversion.Converter.Convert(inputdata , docType)

where inputdata is the content of the file in a Byte()
and docType is simply PDF, JPG, etc.



As always, anything I can do to help, please advise.

Thanks



Posted by a ceTe Software moderator
Hello,

Thanks for this information. We will have to set up a similar test machine to recreate the issue. If we need any additional information, we will let you know. If not, we will post an update as soon as we are finished with our testing.

Thanks,
ceTe Software Support Team
Posted by a ceTe Software moderator
Hello,

We have finished testing in the following operating systems: Win 8.1 x64, Win 10 x64 with French (Canada) language settings and we have not been able to recreate the issue. Both machines we are able to successfully convert png and jpeg images to PDF without any issue.

The test machines we used have the most recent Windows updates installed. So please make sure you have all the Windows updates installed on the machine where you are testing. If you are using a Win 8 machine, please make sure it is update to Win 8.1. For Win 10, please make sure all recent updates are installed.

Thanks,
ceTe Software Support Team
I will see if we can find out anything further and will report back.

Thanks

All times are US Eastern Standard time. The time now is 7:37 AM.