Search code examples
c#silverlightsilverlight-4.0processsilverlight-oob

Find Which Silverlight Out of Browser App is Running Under sllauncher.exe


How can I find which Silverlight OOB app is running?

If I get a list of processes, the SL OOB apps are running under the sllauncher.exe process. They are invoked with arguments with the ID of the SL app, but I can't see the arguments in Process.StartInfo.Arguments.

Is there a way to see what app is actually running under sllauncher.exe?


Solution

  • There is no point using Process.StartInfo.Arguments for processes that you did not start. It only contains meaningful data if your program have started the process using these arguments.

    You can use WMI though, like so:

    var processQuery = new SelectQuery("SELECT Commandline FROM Win32_Process");
    var scope = new System.Management.ManagementScope(@"\\.\root\CIMV2");
    var searcher = new ManagementObjectSearcher(scope, processQuery);
    ManagementObjectCollection processes = searcher.Get();
    foreach (var process in processes)
    {
         Console.WriteLine(process["Commandline"]);
    }