Versioning issues with winforms controls hosted in IE

A client has a third-party application written for version 1.0 of the runtime. This is a web application using windows forms controls in the browser.

Now, we have built an app using version 1.1 of the runtime for this client.

It turns out that the third-party controls hosted in IE does not work properly on version 1.0 of the runtime.  If we install 1.1 on the client machines the existing app breaks. But we need the new runtime for our app!

To me part of the side-by-side story is that you can install a new version of the runtime side-by-side with older versions. Existing applications built on earlier version will not break. You can make applications run on older versions of the runtime by specifying the required runtime in the config file.

According to the MSDN doc, IE will always host using the latest version of the runtime:

All managed controls hosted by Internet Explorer use the latest version of the common language runtime installed on the computer. This means that in some instances the control may not run against the version it was built with if several version of the runtime are installed on the computer.

And  here:

COM applications hosted by an extensible host, such as Microsoft Internet Explorer or Microsoft Office cannot control which version of the runtime is loaded.

We have found that we can actually specify the required runtime for IE. We created an iexplore.exe.config file specifying 1.0 as the required runtime. That makes IE host using 1.0! Not the perfect solution but it works in our case.

The first big app we built on .NET for a client also used controls hosted in IE and we found that it worked well once we worked around the security issues and getting the control to communicate with IE. Using windows forms controls in the browser sort of gives you the best of both web and windows. I talked to people from this client at the last user group meeting and the app has been working without problems since it was deployed. Always nice to hear!

No Comments