With LightSwitch for Visual Studio 11 Beta, the client is now built using Silverlight 5. One of the capabilities new to SL 5 is the ability to access certain classes and methods In-Browser that were previously only accessible Out-of-Browser.
Before proceeding, you should know that there are a few caveats. One is that you need to change some registry settings on each client machine to enable Elevated Trust applications to run In-Browser. Alternatively you can use Group Policy settings to accomplish this. Also, clients must use Internet Explorer. Finally, you must sign your XAP and be sure that the signing certificate is installed in the Trusted Root Certification Authorities store. You can find more information about these requirements here.
With vanilla Silverlight 5 applications, you can go to the application properties page and check “Require elevated trust when running in-browser”.
This setting, however, is not surfaced from the Visual Studio UI when working with a LightSwitch application. So for LightSwitch, you’ll need to edit the csproj file manually. Make sure your solution is closed in VS and find the csproj (or vbproj) file in the Client folder of your LS project. Find the <OutOfBrowserSettingsFile> line and add this line below it:
Save the file, then in the Properties folder, create this InBrowserSettings.xml file:
<InBrowserSettings> <InBrowserSettings.SecuritySettings> <SecuritySettings ElevatedPermissions="Required" /> </InBrowserSettings.SecuritySettings> </InBrowserSettings>
With that done, you should be able to make use In-Browser of the WebBrowser control, the Office Integration Pack, and many other controls previously restricted to Out-Of-Browser apps.