16

There is a similar question: Loading .NET UserControls in IE with .NET 4.0 This question is essentially the same, but for .NET 4.5

That question starts with: I've got a legacy app where there's a UserControl which is used as an activex in a web page loaded in IE. Before .NET 4.0, there were security policies and a MMC console for creating code groups, etc. It seems like that is all gone with .NET 4.0.

After installing .NET 4.5 it seems the workaround is no longer working, and that IE is unable to load any usercontrol. My fear is that this feature is removed altogether. In that case we have some serious rewriting to do before our users can install .NET 4.5

Some notes:

  • Everything was working perfectly fine with the .NET 4.5 RC. 8-(
  • Fuslogvw (Assembly Binding Log Viewer) Behaves as expected before upgrade, but after upgrade it is not logging anything. (And usercontrol is not being loaded.)
  • In production the controll will have to run with full trust, but all my testing has been done with a simple control that does not require this
  • Anybody who has sugestions or information regarding this feature?

    thanks

    Community
    • 1
    • 1
    Steinar Herland
    • 1,134
    • 1
    • 9
    • 15
    • I am having a similar issue with upgrading win7 with .NET 4.5. A colleague has successfully been able to load the user control in win 8 x64, after downloading and installing the .NET 3.5 framework. I'm not sure what the issue is at this time, but I am investigating as well. – Gary Aug 24 '12 at 18:49

    1 Answers1

    31

    This is documented in the .NET 4.5 Application Compatibility Page on MSDN: http://msdn.microsoft.com/en-us/library/hh367887.aspx . Hosting managed controls inside IE is no longer supported out of the box (see half-way down under "Web Applications"):

    Feature: Managed browser hosting controls from the .NET Framework 1.1 and 2.0

    Change: Hosting these controls is blocked in Internet Explorer.

    Impact: Internet Explorer will fail to launch an application that uses managed browser hosting controls. The previous behavior can be restored by setting the EnableLegacyIEHosting value of the registry subkey HKLM/SOFTWARE/MICROSOFT/.NETFramework to 1.

    Unfortunately, the information on the registry key appears to be incomplete and wrong:

    • The setting is actually called "EnableIEHosting".

    • It must be located either in the HKCU Hive: HKCU\SOFTWARE\Microsoft\.NETFramework

    • or the HKLM hive, but under different paths, depending on the 32/64bit type of Windows:
      • 32-bit System: HKLM\SOFTWARE\MICROSOFT\.NETFramework
      • 64-bit System: HKLM\SOFTWARE\Wow6432Node\Microsoft\.NETFramework

    This was tested on both Windows Server 2008R2 and Windows 8.

    Michael
    • 446
    • 4
    • 7
    • 2
      Thanks! I can add that "EnableIEHosting" must be a DWord and not QWord or string.. – Kipotlov Jun 07 '13 at 14:47
    • 3
      You just saved my job :-D – OnesimusUnbound Jul 29 '13 at 09:22
    • Thanks a lot! I'd found this answer somewhere else, but upgrading to windows 8.1 and IE 11 seemed to have removed this from my registry. Might still be a bit easier to migrate to Silverlight 5 and limp along with that for a bit before the next already-sentenced-to-death technology is given the abilities we need =) – ps2goat Nov 26 '13 at 07:35
    • Looks like the MSDN article has been updated with the correct information. – fejesjoco Jan 08 '14 at 16:16
    • HKLM\SOFTWARE\Wow6432Node\Microsoft\.NETFramework does not exist on windows 10 build 1511 machines (if you didn't upgrade to win10) – Alexander Ryan Baggett Sep 19 '16 at 16:54