none
IIS 7, .NET Framework 4.5.1 RRS feed

  • Question

  • We have an ASP .NET application that was initially created using .NET Framework 4.0.  This application uses the iframe tag extensively and requires that its runat attribute be set to server.

    The application worked just fine in .NET Framework 4.0, but when I upgraded it to .NET Framework 4.5.1, I noticed that the class behind the iframe tag changed from HTMLGenericControl to HtmlIframe.  I cut the iframe tags, rebuilt the app, and then undid the cut and rebuilt again.  This action resolved the problem in Visual Studio 2013.

    I then attempted to deploy the application to our server (Windows Server 2008 R2 Datacenter, SP1) which only had .NET Framework 4.0 installed.  I installed 4.5.1 (found here: http://www.microsoft.com/en-us/download/details.aspx?id=40779) and ran aspnet_regiis –r found here: C:\Windows\Microsoft.NET\Framework64\v4.0.30319.  Doing so should change all my application pools to use the 4.5.1 version of .NET Framework

    I then ran the application and on pages that have iframe tags, I got the following error:

    The base class includes the field 'ifrMain', but its type (System.Web.UI.HtmlControls.HtmlIframe) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlGenericControl).

    This message seems to say that while parsing the ASPX, IIS found a control, ifrMain, that it identifies as an HtmlGenericControl but found, in the base class, a reference to an HtmlIframe.

    My read of the message is that I’ve got a compiled app using 4.5.1 because it uses HtmlIframe, but IIS 7 is using 4.0 because it’s expecting an HtmlGenericControl.

    I uninstalled 4.5.1 and reinstalled it, repeating the aspnet_regiis step. I have rebooted the machine a couple of times.  All to no avail.

    The file date of aspnet_regiis I’m using is 9/11/2013, which is pretty much what you’d expect give the October, 2013 release date of 4.5.1.  Oddly, when I run aspnet_regiis, I see a version 4.0.30319.18408, which is the version number of the 4.0 release.  Given Micosoft’s method of handling these incremental releases, I suppose that version number seems in order, but I cannot tell.

    So, I have three questions/issues. 

    1.        First, how can I verify the version that IIS 7 is actually using?
    2.        How do I ensure that II 7 uses the newly-installed 4.5.1?
    3.        If my assumption about the error message I’m receiving is wrong and I am actually using 4.5.1, how do I resolve the error message?
    Wednesday, February 11, 2015 6:17 PM

Answers

  • Boy, this is embarrassing.  I neglected to change the targetframework param in my web.config.  Changed and voila, it's working just fine.

    Apologies to anyone who's started to look at this.

    • Marked as answer by Bruce Fullwood Wednesday, February 11, 2015 8:12 PM
    Wednesday, February 11, 2015 8:12 PM