Loading .NET UserControls in IE with .NET 4.0

前端 未结 2 616
误落风尘
误落风尘 2020-12-17 04:37

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

2条回答
  •  别那么骄傲
    2020-12-17 04:57

    Ok, after several tests, I've managed to make it work. Here are some things you should keep in mind:

    • you cannot compile your assembly against .NET 4.0 because IEHost was deprecated in .NET 4.0. So, you'll have to compile against .NET 3.5
    • Since you're compiling against .NET 3.5, don't forget to set the correct security policies in the .NET 2.0 configuration console

    And, the most important thing of all: don't forget to set the policies in the correct version of .NET. In my case, I'm running on a x64 machine and so I went ahead and installed the x64 bits version. setting the correct policies in the installed console didn't really work, so I had to download and install the x86 version. After doing that, everything started working well (after all, IE was running as a 32 bit app)

    Once again, I can't really understand MS' decision of deprecating IEHost without introducing a new option.

提交回复
热议问题