web.config does not recognize <applicationInitialization> tagRSS

15 replies

Last post Jul 27, 2019 05:47 PM by lextm

  • web.config does not recognize <applicationInitialization> tag

    May 21, 2012 05:12 AM|danhoch|LINK

    Hi,

    I'm trying to use application initialization with IIS 7.5  running on windows 7.

    I was following the step-by-step instructions that Shaun Eagan posted here: http://learn.iis.net/page.aspx/1089/iis-80-application-initialization/,

    and yet, it seems that nothing's really happening. The app init tag is not recognized in the web.config file of the application i use.

    My local site is available and loads the first page, but there is no initialization, that supposed to be called in a different page.

    Of course, I installed the 64 bit version of the app init msi, that matches my platform.

    what indicators can I look for locally, to know that the module was integrated successfully into the system and the IIS?

    Thanks,

     Danny

     

    IIS 7.5 ApplicationInitialization

  • bariscaglar bariscaglar

    14 Posts

    Microsoft

    Moderator

    Re: web.config does not recognize <applicationInitialization> tag

    May 25, 2012 05:42 PM|bariscaglar|LINK

    Hi Danny,

    Application Initialization does not have a UI element that you can do a quick check to see whether it is working or not. Checking applicationHost.config file to see if all the wiring is done correctly is the only way to go. but since you followed the directions that is implied. Sometimes some custom modules installed on the machine depending on the order of execution can interfere with the execution of others. If you have any such modules you could try uninstalling them and see if that makes any difference. Finally, are you trying to run the sample application provided (http://learn.iis.net/file.axd?i=3848) or do you have a custom application?

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

    May 29, 2012 05:35 AM|danhoch|LINK

    Thank you for your reply.

    I'm not running the sample application. I'm trying to run an existing system that has WCF services to run on IIS.

    The thing is that some initialization operations must run before the rest of the services start.

     

  • bariscaglar bariscaglar

    14 Posts

    Microsoft

    Moderator

    Re: web.config does not recognize <applicationInitialization> tag

    May 29, 2012 04:52 PM|bariscaglar|LINK

    There are two things I would do in that situation. I would try the sample application and see if I can at least get the most simple application initialization scenario working or not. In either case, I would enable FREB and see for the failed case wheter app init module is being invoked and the result of that operation.
  • Re: web.config does not recognize <applicationInitialization> tag

    Jun 08, 2012 07:49 AM|criss_iss|LINK

    hello,

    <applicationInitialization> tag is not recognized either in my web.config. Can it because of the framework version? Im using 3.5 instead of 4. If so, anyone has any idea of how to set it up for 3.5? if dont, why isnt recognized?

    thanks!

  • ahmels ahmels

    5 Posts

    Microsoft

    Re: web.config does not recognize <applicationInitialization> tag

    Jun 08, 2012 11:49 PM|ahmels|LINK

    the .NET version is irrelevant to how the Application Initialization tags are recognized

    please make sure you have the <applicationInitialization> tag in the correct place in web.config

    for example:
    <system.webServer>
            <applicationInitialization skipManagedModules="true" remapManagedRequestsTo="startup.asp">
                <add initializationPage="default.aspx" />
            </applicationInitialization>
    </system.webServer>

    you can also check the IIS schema folder for to make sure the appwarmup_schema.xml file is there

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

    Jun 15, 2012 08:33 AM|deanward81|LINK

    I have the same problem - installed the x64 build of the Application Initialization module and IIS throws on initialization with the following error:

    HTTP Error 500.19 - Internal Server Error

    The requested page cannot be accessed because the related configuration data for the page is invalid.

    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'.

      In %SystemRoot%\System32\inetsrv\config\schema there's an appwarmup_schema.xml containing the following:

    <configSchema>
      <sectionSchema name="system.webServer/applicationInitialization">
        <attribute name="remapManagedRequestsTo" type="string" defaultValue="" />
        <attribute name="skipManagedModules" type="bool" defaultValue="false" />
        <attribute name="doAppInitAfterRestart" type="bool" defaultValue="false" />
        <collection addElement="add" clearElement="clear" removeElement="remove" mergeElement="false">
          <attribute name="initializationPage" type="string" required="true" isUniqueKey="true" />
          <attribute name="hostName" type="string" defaultValue="" />
        </collection>
      </sectionSchema>
      <sectionSchema name="system.applicationHost/sites">
        <collection addElement="site">
          <collection addElement="application" >
            <attribute name="preloadEnabled" type="bool" defaultValue="false" />
          </collection>
          <element name="applicationDefaults" isCollectionDefault="true">
            <attribute name="preloadEnabled" type="bool" defaultValue="false" />
          </element>
        </collection>  
      </sectionSchema>
    </configSchema> 

    It clearly doesn't recognise the schema. Any ideas what's going wrong? Thanks, Dean

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

    Jun 15, 2012 08:40 AM|deanward81|LINK

    Oddly enough the Configuration Editor within IIS Manager recognises that system.webServer/applicationInitialization is valid schema... Must be missing something obvious here.
  • Re: web.config does not recognize <applicationInitialization> tag

    Jun 15, 2012 09:56 AM|deanward81|LINK

    OK it's recognised just fine in full IIS, but not in IIS Express. However in full IIS it doesn't seem to do anything.

     I have an application with a Thread.Sleep(10000) in its Application_Start that I'm using for testing and adding the following configuration to it has no effect:

      <system.webserver>
        <applicationinitialization skipManagedModules="true" remapManagedRequestsTo="app_startup.htm"></applicationinitialization>
      </system.webserver> 

    The sample app works just fine. Copying the sample application's configuration to my app doesn't work either so I'm not convinced it's a configuration problem. I can see from Request Tracing that the warmup module is running, but it doesn't seem to actually do what it says on the tin!

    Thanks,

    Dean

    PS. Not sure if the iis.net developers are around but the rich text box doesn't work at all in Chrome...

  • ahmels ahmels

    5 Posts

    Microsoft

    Re: web.config does not recognize <applicationInitialization> tag

    Jun 15, 2012 02:00 PM|ahmels|LINK

    Hi Dean,

    is your application using a .NET 2 app pool (.NET 2 and 3.5 applications) ?

    If so you should use a rewrite rule instead of remapManagedRequestsTo="app_startup.htm" tag.

    you can verify that this application is wroking by skipping the Default Document module, i.e instead of accessing your application like this

    http://localhost:<port>/MyApplication/

    try to access it like this

    http://localhost:<port>/MyApplication/default.aspx

    or whatever your default page is.

    If this works for you, having a rewrite rule using URL Rewrite module will solve the problem for you 

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

    Jun 20, 2012 05:52 AM|deanward81|LINK

    I'm running in a .NET 4.0 application pool, so assume that the remapManagedRequestTo should work? We're using MVC so the concept of Default Document doesn't really factor in here. I'll try and work out what the difference is between our app and the sample one! Cheers, Dean
  • Re: web.config does not recognize <applicationInitialization> tag

    Aug 29, 2012 07:50 AM|czliquid|LINK

    I got the same problem. Tag <applicationInitialization> is not available.

    I'm using SharedConfiguration, IIS 7.5 Win2k8 R2.

    Tag <applicationInitialization> is available as soon as I cancel SharedConfiguration.


    How can I make IIS use the tag <applicationInitialization> in SharedConfiguration?

  • bariscaglar bariscaglar

    14 Posts

    Microsoft

    Moderator

    Re: web.config does not recognize <applicationInitialization> tag

    Oct 09, 2012 03:12 PM|bariscaglar|LINK

    Dean, have you made sure that your application pool is in integrated mode and not the classic mode?
  • Re: web.config does not recognize <applicationInitialization> tag

    Mar 18, 2013 07:29 AM|tamarel|LINK

    Hi,

    This is pretty old but I came across it as I'm trying the same thing. I've got the appinit example working, but my WCF service is not warming up. What I think is that the warmup knows to browse the application by just adding "\". For sites with a default page - this will work. But when browsing to an application that hosts a WCF service, browsing to http://localhost/MyService/ does not create an actual request to the service. You need to browse to http://localhost/MyService/Service.svc for getting the service up. So I added a URL Rewrite rule that redirects from http://localhost/MyService/ to http://localhost/MyService/Service.svc and it seems to work. But I was wondering if anyone has a better solution for this, and more specifically if I can decide what the "warmup" url request will be.

    Thanks.

  • 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.

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

    Jul 27, 2019 05:47 PM|lextm|LINK

    For IIS 7.x application initialization module is an extra download (MSI), so you need to install it before doing anything else.

    Lex Li
    IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.