We're trying to Enable Silverlight 5 Trusted Applications to Run within the Browser. Goal : Access the MyVideo folder within MyDocuments which is usually accessible using Out of Browser Elevated settings in Silverlight 4 version.
Software : Silverlight 5 with VS2010 Express.
Issue : VS2010 shows an security exception while accessing the "My Videos" folder within the "My Documents" folder with "Elevated Permissions" setting.
Other Settings :
- The Registry entry required to elevating the permissions done from this link
- Signing of XAP using self signed certificate done from this link
Sample Code :
if (!Application.Current.HasElevatedPermissions)
{
MessageBox.Show("No elevated permission set");
}
String myVideoPath =
//[breakpoint set Here]
Environment.GetFolderPath(Environment.SpecialFolder.MyVideos).ToString();
Security exception trapped @ breakpoint in VS2010 :
[FileSecurityState_OperationNotPermitted] Arguments: Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See
Are there any more settings to be able to access the MyVideo folder using a pure In Browser Silverlight 5 application ? Have found that the we still require to temporarily set the "Out of browser" setting in order to run In browser as a Trusted Application.
Any pointers that would help resolve the security exception seen are welcome !
TIA
I also found that you will need to leave
Enable running application out of browser
checked in order to run an in-browser app that will access the file system. I believe this is simply beta verbage in Visual Studio that will eventually be updated.See:
http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2011/04/27/silverlight-5-beta-rough-notes-trusted-apps-in-the-browser.aspx