Start OneClick Application from a Windows Service

0

I am developing a Windows service, which aims to be verifying if an application is running or not and if it is not running, what you should do is run the application.

The application that must run is OneClick Application type (.appref-ms), for which I use the following code.

Application = @"C:\User\MyUser\App.appref.ms";
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = Application;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.Start();

When I throw the exception the description says the following:

  

The specified executable is not a valid application for this   operating system platform.

Could someone guide me to find a way to run the application from the code. Thank you very much in advance.r

    
asked by Randall Sandoval 31.07.2018 в 21:00
source

0 answers