2

I just created a new project in MVC3 using EF4 code first deployed on Windows Azure. I want to keep my "web.config" file as clean as possible because it's a little complicated to understand all tags it contains.

I notice two sections: <system.web> and <system.webServer>

The first is for IIS6 and the second for IIS7+ I do not need backward compatibility so want to delete the first.

I converted a good part of the first into the second, but I cannot find how to convert these sections:

<system.web>
  <authentication mode="None" />
  <compilation debug="true" targetFramework="4.0">
    <assemblies>
      <add assembly="System.Web.Helpers, Version=2.0.0.0, Culture=neutral />
      <add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral />
      <add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral />
      <add assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral />
    </assemblies>
  </compilation>
  <pages validateRequest="false">
    <namespaces>
      <add namespace="System.Web.Helpers" />
      <add namespace="System.Web.Mvc" />
      <add namespace="System.Web.Mvc.Ajax" />
      <add namespace="System.Web.Mvc.Html" />
      <add namespace="System.Web.Routing" />
      <add namespace="System.Web.WebPages" />
    </namespaces>
  </pages>
</system.web>

How to do this so that I can delete the deprecated <system.web>?

sharptooth
  • 167,383
  • 100
  • 513
  • 979
Francesco Cristallo
  • 2,856
  • 5
  • 28
  • 57

1 Answers1

2

Not all of the elements are deprecated. The two most important sections are /system.web/httpHandlers which has moved to /system.webServer/handlers and /system.web/httpModules which is now /system.webServer/modules. You shouldn't need to touch the above configuration any further as the elements within are still part of the system.web element even in IIS7. Have you tried running your site after your changes?

Andreas
  • 1,355
  • 9
  • 15
  • Thanks, my site works as expected until i don't delete the above remaining code in system.web (that i'm trying to convert), if instead i delete the above totally, does not work in authentication ( custom ) cause the first line that is necessary. I think that there's some in the security tag of system.webServer but need more investigations – Francesco Cristallo Jan 13 '12 at 18:50
  • You don't need to convert what's left. It hasn't changed in IIS7. – Andreas Jan 14 '12 at 19:15