I had the privilege of working with Silverlight 4 pre-beta bits in preparation for one of the PDC keynote demos. One of the coolest new features just announced for SL is support for running in “full trust” out of browser. This allows full access to the machine from within the Silverlight code – you can communicate with other software on the machine, hardware devices, etc. (The user has to accept the OOB dialog with some extra text warning of the full trust setting)
There is an XML file named OutOfBrowserSettings.xml that goes in the project properties folder. This file was first introduced for OOB in Silverlight 3. In SL4, there is one additional element:
Visual Studio 2010 Beta 2 now has support for setting this value in the OOB properties dialog.
Detecting Full Trust Status
In the Silverlight application code, you can detect if you’re running full trust by inspecting a property on the Application object.
Now What Can I Do ?
One of the things we did for the keynote demo is to integrate the app with Microsoft Office. We create Excel spreadsheets, Word documents, Outlook meeting request, even check the Outlook calendar for available meeting times. There is no built-in support for Office in the Silverlight class library, so you have to resort to COM to talk to Office. Use the ComAutomationFactory.CreateObject() method to create a COM object from its ProgID, and you’re off and running. From there, it’s just working through the Office object model.
With full trust, it’s almost unlimited what you can do from the Silverlight client code (local devices like cameras, scanners, bi-directional communication with COM objects, etc).