Sunday, April 18, 2010

Is Silverlight 4 able to call Win32 API functions when running Out of Browser (OOB)?

With the new relaxed security model of Silverlight 4, I was curious if would finally be possible for Silverlight to directly call Win32 API functions, particularly when running out of browser. You could argue that it shouldn’t, as an application with such capabilities could certainly invoke unwanted behavior. But regardless of whether it would be a good thing or not, I was still curious if it could.

After much testing it appears the answer is no. I get an error like the following when attempting to access various Win32 API functions out of browser, even after signing the assembly.