1

I am trying to access a webpage (that is not under my control) namely allscripts sandbox via a WebBrowser control. My computer's internet explorer is correctly set up for said webpage (Added in Trusted Sites, Allowed and installed all active-x addons, running in compatibility mode, etc).

The webbrowser control displays the following error:

This webpage wants to run 'Some ActiveX control' which isn't compatible with Internet Explorer's enhanced security features. If you trust this site you can disable Enchanced Protected Mode for this site and allow the control to run.

I have not enabled (to the best of my knowledge) the enhanced protected mode.

Also trying to ignore the errors and continue with log-in displays a Message

The Centricity's container for .NET-based pages failed to initialize. Make sure your .NET environment is configured to grant Full Trust to this Website.

The above was also an error on the default IE until i run the command %WINDIR%\Microsoft.NET\Framework\v2.0.50727\caspol -q -m -cg Trusted_Zone FullTrust.

I have tried various registry keys but none seemed to work.
I have also tried implementing a custom IInternetSecurityManager that Maps all urls to zone Trusted and returns URLPOLICY_ALLOW on all ProcessUrlAction calls.

Any suggestion would be appreciated.

Community
  • 1
  • 1
Kostas Aronis
  • 11
  • 1
  • 4
  • When you navigate to the page using ie11 separately, does it work ok? – Andy Dec 10 '18 at 17:41
  • Yes @Andy it works fine, i had to enable compatibility mode, add it to the trusted sites and allow and download all the required activex add-ons but after that it worked. – Kostas Aronis Dec 11 '18 at 07:58

2 Answers2

0

The problem could be that webbrowser uses by default an old version of the IE. Take a look at Use latest version of Internet Explorer in the webbrowser control

FloriUni
  • 346
  • 2
  • 10
  • Thanks for taking the time to answer.I have tried all versions of IE by setting the registry key. None of them worked. Also the site is designed to be run in compatibility mode with IE7 so we are good on that front. Any other ideas? – Kostas Aronis Dec 10 '18 at 13:03
  • Maybe different architecture? 32bit vs. 64bit? – FloriUni Dec 10 '18 at 13:06
0

The webbrowser control is ie11 wrapped with a com wrapper that throttles back ie11 to ie7 mode. There's not a lot else going on there that I can imagine would cause your issue.

Since this page works for you when you run ie11 externally then the most likely explanation seems to be your attempt to force the control into ie11 mode is the problem. I suggest you try Mentor's code here:

Set WPF webbrowser control to use IE10 mode

Which will automate adding the name of the running program to the registry.

var pricipal = new System.Security.Principal.WindowsPrincipal(
 System.Security.Principal.WindowsIdentity.GetCurrent());
 if(pricipal.IsInRole(System.Security.Principal.WindowsBuiltInRole.Administrator)) {
    RegistryKey registrybrowser = Registry.LocalMachine.OpenSubKey
     (@"Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION", true);
string myProgramName = Path.GetFileName(System.Reflection.Assembly.GetExecutingAssembly().Location);
var currentValue = registrybrowser.GetValue(myProgramName);
if (currentValue == null || (int)currentValue != 0x00002af9)
    registrybrowser.SetValue(myProgramName, 0x00002af9, RegistryValueKind.DWord);
}
else
this.Title += " ( Первый раз запускать с правами админа )";
Andy
  • 11,864
  • 2
  • 17
  • 20