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.
I was wondering if someone could give me some clues on how to update my UserControl project so that it works against .NET 4.0. I've been running some tests and none of them seem to work. In fact, I've noticed that if I update the .NET version of my UserControl to 4.0 before compilint it, it won't even be added to the GAC download area. It gets downloaded (used fiddler to test it) but it simply isn't added to the GAC's download area. Setting the .NET platform version to 3.5 or below, means that the dll is added to the GAC but it's still unusable from the web page (the old JS code that worked before keeps saying that it cannot find member X on object Y).
So, can anyone point me to the right direction? What do I need to do in .NET 4.0 to load a .NET UserControl in Internet Explorer?
thanks.
Hosting controls in IE is now blocked by default (as of v4 or v4.5). See MSDN article under 'Web Applications'.
Fortunately it is super-easy to re-enable the functionality with these reg keys:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
"EnableIEHosting"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework]
"EnableIEHosting"=dword:00000001
The x64 key was the one that fixed it for me, running IE8 (x32) on Win7 (x64) using a .Net v3.5 SP1 control compiled for x32.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With