Changes in web.config when .net framework is upgraded to 4.0 from 3.5 RRS feed

  • Question

  • User-510697852 posted

    I have web application which was originally written in .net framework 3.5. I have changed .net framework to 4.0.

    I noticed some changes in web.config file. 

    Under 3.5 I had  <runtime /> section in web.config file. But when I changed to .net framework to 4.0, I can not see this section in web.config file.

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="" newVersion=""/>
    <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="" newVersion=""/>
    </runtime>            // This section not present in web.config under 4.0 framework.

    I had under 3.5 framework,

    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    But under 4.0 I have following,

    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />


    Wanted to know about these changes. Do I need to add <runtime /> section and change <pages /> section like 3.5 framework?

    Friday, January 12, 2018 8:32 AM

All replies

  • User753101303 posted


    Seems quite standard so no. Does it work ? Options were added over time to the web.config file and in 4.0 it was moved again to the general machine.config file so that you can have a simpler web.config file.

    The options you see is to generate the same HTML markup and client ids in case you would have code depending on that...

    Edit: see https://msdn.microsoft.com/en-us/library/s57a598e.aspx#aspnet_core_services and "Web.config File Refactoring".

    Friday, January 12, 2018 8:41 AM
  • User-510697852 posted

    Yes without <runtime> section and <pages> section as per 4.0 it's working fine.

    Sunday, January 14, 2018 1:35 PM