We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

View Complete Thread
  • Re: web.config does not recognize <applicationInitialization> tag

    Aug 31, 2018 04:11 PM|FredChau|LINK

    Hi,

    deanward81

    Visual Studio tells me that the web.config is not valid with the following warning:

    The element 'system.webServer' has invalid child element 'applicationInitialization'. List of possible elements expected: 'asp, caching, cgi, defaultDocument, directoryBrowse, globalModules, handlers, httpCompression, httpErrors, httpLogging, httpProtocol, httpRedirect, httpTracing, isapiFilters, modules, odbcLogging, security, serverRuntime, serverSideInclude, staticContent, tracing, urlCompression, validation, management'.

    About the validation in Visual Studio, it's "normal" since the ApplicationInitialization module installed is not part of the IIS 7.5 standard, and is added as a standalone plugin.
    So that mean that the default .Net Framework schema used for Web.config (for at least .NET Framework 3.5 and 4.0) by Visual Studio won't include the "new" ApplicationInitialization element. 
    You will have to add manually that "ApplicationInitialization" element in the file "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Xml\Schemas\DotNetConfig35.xsd" or "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Xml\Schemas\DotNetConfig40.xsd" (Administrator Right needed to modify those files) between the "modules" and "odbcLogging" elements, the correct "ApplicationInitialization" element can be extracted from "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Xml\Schemas\DotNetConfig45.xsd".

    Note that I use the base folder "C:\Program Files (x86)\Microsoft Visual Studio 14.0" for Visual Studuio 2015 in a x86 installation, but that base folder need to be adapted if you're using a different plateform or a different version of Visual Sudio.
    And note also that thoses "manual" changes may be further override by Service Pack installation or Windosx Update for Visual Studio, so you'll have to redo those operations.