ASP.NET-4 IIS7.5 web.config serverRuntime element
Asked Answered
I

3

10

Whenever I add this line to my web.config in the system.webServer section:

<serverRuntime />

With our without properties, IIS 7.5 just serves up a blank page instead of the website. I created a new empty Web Application using IIS and added the line to the web.config; blank page.

What am I doing wrong?

Insular answered 28/8, 2010 at 11:33 Comment(2)
To say what you are doing wrong you will first need to say what are you trying to do. Why do you need this?Maxey
I need it to set frequentHitThreshold to 1 to enable gzip compression for CSS.Insular
A
26

I had this exact problem and solved it by unlocking the serverRuntime section of the applicationHost config. Command to run at console:

%windir%\system32\inetsrv\appcmd unlock config -section:system.webServer/serverRuntime
Amphimacer answered 25/6, 2014 at 14:47 Comment(0)
D
9

So you are actually adding this to your web config?

<location path="Default Web Site">
   <system.webServer>
      <serverRuntime enabled="true"
         frequentHitThreshold="1"
         frequentHitTimePeriod="00:00:20" />
   </system.webServer>
</location>

There are several important things to bear in mind...

  1. That you are running IIS7 in integrated mode, not classic mode.
  2. That you have the enabled="true" attribute set on serverRuntime

Further reading on MSDN

http://msdn.microsoft.com/en-us/library/aa347568%28VS.90%29.aspx

Drucilladrucy answered 7/9, 2010 at 7:0 Comment(1)
Actually, Haney’s answer might be more relevant. At least on the servers where I have tried it, simply adding the serverRuntime element to web.config will cause an error when any paths matched by the corresponding location specification are hit. Either, one can do the configuration directly in appSettings.config, as described in iis.net/configreference/system.webserver/serverruntime (which is what I did), or presumably, unlocking the element as suggested by Haney will make it possible to have the configuration in web.config.Rossanarosse
P
0

If you prefer doing things from the user interface, you can unlock the section from IIS Manager:

  1. Open IIS Manager
  2. Select the server name on the "Connections" pane
  3. Click "Configuration Editor" in the "Management" section (screenshot below)
  4. Select/search for the section you want to unlock
  5. Then click "Unlock" in the "Actions" pane on the right (see screenshot)

Server Home

Configuration Editor

Percept answered 1/5 at 8:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.