开发者

How to Enable Trusted Applications to Run Inside the Browser, silverlight5.0

开发者 https://www.devze.com 2023-03-12 23:33 出处:网络
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 setti

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 :

  1. The Registry entry required to elevating the permissions done from this link
  2. 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_OperationNot开发者_高级运维Permitted] 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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号