The configuration (StaticFileModule) under IIS 7 is invalid to IIS 10RSS

6 replies

Last post Dec 09, 2019 07:32 AM by Jalpa Panchal

  • The configuration (StaticFileModule) under IIS 7 is invalid to IIS 10

    Dec 06, 2019 06:12 AM|sekikou|LINK

    The web.config of IIS 7 has a configuration similar to the following for dynamic and static separation. For example, the gif file wants to be parsed by IIS, and the dynamic file is parsed by the application server like this:

    <handlers accessPolicy="Read, Execute, Script">
        <add name="aaa(*.gif)" path="*.gif" verb="*" modules="StaticFileModule" resourceType="Either" />
    ...

    After the server was upgraded from 2008 to 2017, The IIS version is upgraded to 10,  and the configuration above was found to be invalid. IIS returned a 500 error for all requests for static files.

    Does this configuration fail in IIS 10, and how should I change it? Thank you

  • Re: The configuration (StaticFileModule) under IIS 7 is invalid to IIS 10

    Dec 06, 2019 10:35 PM|lextm|LINK

    The actual 500 error page usually contains all the details you need. Newer IIS releases usually add more MIME types/handlers, so you should test if you still need your own MIME types/handlers on IIS 10.

    Lex Li
    Affordable IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: The configuration (StaticFileModule) under IIS 7 is invalid to IIS 10

    Dec 09, 2019 02:16 AM|Jalpa Panchal|LINK

    Hi,

    Make sure you enabled the "Static Content" and "directory browsing" feature of iis is enabled. 

    and mime-type is available.

    you could also use below web.config setting:

    <handlers>      	
           
            <add name="StaticFileModuleGif" path="*.gif" verb="*" modules="StaticFileModule" resourceType="File" requireAccess="Read" />
              
        </handlers>

    if you you still face an issue. please share your detailed error message snapshot and web.config file.

    Regards,

    Jalpa

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
  • Re: The configuration (StaticFileModule) under IIS 7 is invalid to IIS 10

    Dec 09, 2019 02:19 AM|sekikou|LINK

    thanks for your advice,i follow the error message,and delete this from web.config and i can see the page!

    <staticContent>
    <mimeMap fileExtension=".json" mimeType="application/json" />
    </staticContent>

  • Re: The configuration (StaticFileModule) under IIS 7 is invalid to IIS 10

    Dec 09, 2019 02:21 AM|Jalpa Panchal|LINK

    is your issue resolved?

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
  • Re: The configuration (StaticFileModule) under IIS 7 is invalid to IIS 10

    Dec 09, 2019 07:26 AM|sekikou|LINK

    Jalpa Panchal

    is your issue resolved?

    Yes,According to the 500 detailed information, after deleting a json setting in web.config, the problem was solved.

  • Re: The configuration (StaticFileModule) under IIS 7 is invalid to IIS 10

    Dec 09, 2019 07:32 AM|Jalpa Panchal|LINK

    I request you to mark the helpful suggestion as an answer it will help other people who face similar issue.

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.