Quantcast
Channel: Silverlight 5 forum
Viewing all articles
Browse latest Browse all 1083

"No application is associated with the specified file for this operation. (Exception from HRESULT: 0x80070483)" : Unable to open image programmatically using AutomationFactory when Paint is default app.

$
0
0

I am facing an issue while trying to open an image file from a Silverlight app in Windows 10 using WScript.Shell.

The code is as follows.

try
        {
            dynamic shell = AutomationFactory.CreateObject("WScript.Shell");
            shell.Run(@"C:\temp\X.jpg");
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.StackTrace);
        }

This piece of code works perfectly fine when the default application is set to 'Photos' / 'Internet Explorer' in Windows 10 'Default Apps' settings.

However, when the default app is set to 'Paint', I get an exception "No application is associated with the specified file for this operation. (Exception from HRESULT: 0x80070483)"

Please note that when I try to double click on the same image in Windows explorer, it opens up in Paint application without errors.

Why does this happen? Please help.



Viewing all articles
Browse latest Browse all 1083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>