locked
web.config does not recognize <applicationInitialization> tag RRS feed

  • Question

  • User-1467687025 posted

    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

     

    Monday, May 21, 2012 5:12 AM

All replies

  • User-2102148662 posted

    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?

    Friday, May 25, 2012 5:42 PM
  • User-1467687025 posted

    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.

     

    Tuesday, May 29, 2012 5:35 AM
  • User-2102148662 posted
    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.
    Tuesday, May 29, 2012 4:52 PM
  • User-1072997213 posted

    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!

    Friday, June 8, 2012 7:49 AM
  • User-1797769966 posted

    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 <applicationinitialization></applicationinitialization>

    Friday, June 8, 2012 11:49 PM
  • User1273646629 posted

    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

    Friday, June 15, 2012 8:33 AM
  • User1273646629 posted
    Oddly enough the Configuration Editor within IIS Manager recognises that system.webServer/applicationInitialization is valid schema... Must be missing something obvious here.
    Friday, June 15, 2012 8:40 AM
  • User1273646629 posted

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

    Friday, June 15, 2012 9:56 AM
  • User-1797769966 posted

    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 

    Friday, June 15, 2012 2:00 PM
  • User1273646629 posted
    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
    Wednesday, June 20, 2012 5:52 AM
  • User-893499836 posted

    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?

    Wednesday, August 29, 2012 7:50 AM
  • User-2102148662 posted
    Dean, have you made sure that your application pool is in integrated mode and not the classic mode?
    Tuesday, October 9, 2012 3:12 PM
  • User1063423101 posted

    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.

    Monday, March 18, 2013 7:29 AM
  • User-187207660 posted

    Hi,

    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.

    Friday, August 31, 2018 4:11 PM
  • User690216013 posted

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

    Saturday, July 27, 2019 5:47 PM