Silverlight Hyperlink Button and UNC Path

I have a hyperlink button on a silverlight page. The NavigateUri property sets the path to the UNC folder (\\ myserver \ folder). In Silverlight 4, I could click the link and it will open the folder (after asking the user to allow access). In Silverlight 5, clicking on the link causes a javascript error (shown below). Is this a new limitation with Silverlight 5? Is there any work around?

thanks

Webpage error details Message: Unhandled Error in Silverlight Application Attempted to perform an unauthorized operation. at MS.Internal.XcpImports.CheckHResult(UInt32 hr) at MS.Internal.XcpImports.NavigateToSafeURI(String location, String target, Boolean checkUserInitiatedAction) at MS.Internal.NavigationHelper.Navigate(Boolean checkUserInitiatedAction) at System.Windows.Controls.HyperlinkButton.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags) Line: 1 Char: 1 Code: 0 
+1
source share
1 answer

This is a new restriction introduced in Silverlight 5. They updated the security model to make it more secure, but also explicitly allow this behavior.

Now you can run a trusted application in a browser, and not as applications other than a browser. You need to configure the application as if it were a trusted OOB application, because the "Require increased trust" and "Show installation options" settings are part of the OOB configuration.

To enable the browser in trusted applications, you need to edit the registry on the client machine:

Create / Install AllowElevatedTrustAppsInBrowser to 1

This can be found in HKEY_LOCAL_MACHINE\Software\Microsoft\Silverlight\ for 32-bit machines or HKEY_LOCAL_MACHINE\Software\Wow6432NodeaMicrosoft\Silverlight\ for 64-bit versions.

In addition, .xap files must be signed with a valid certificate, and the certificate must be installed.

A source

0
source

Source: https://habr.com/ru/post/1347977/


All Articles