views:

45

answers:

1

Hello guys.

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.

A: 

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.

Luis Abreu