Last post Jul 27, 2010 09:27 PM by jigkin21
Jul 27, 2010 04:50 PM|jigkin21|LINK
We have 5 production servers in my company. Each server contains almost 50 sites. To hide the ASP.NET version, we have added <httpRuntime enableVersionHeader="false" /> line into web.config file for majority of the sites and pages. However, I have found
that there are few sites and pages doesn't have this line added. Now, it's a pain in a neck to add the line under web.config file for each individual site and the pages. Additionally, we have to do this change into all 5 production servers.
So after my little research, I found that I can simply add this line into machine.config file which will take care of the entire server.
However, I have one silly question. Will this change affect those sites and pages whichever's web.config file already has this line added? OR I have to remove this line from the web.config and then I can add into machine.config? OR It doesn't matter if I
keep on both places (web.config and machine.config) or not?
I am more concern since these 5 servers are production servers and I don't want to take a chance.
Please let me know if you require any more info to answer my question.
Jul 27, 2010 07:31 PM|jigkin21|LINK
The question is more likely for the ASP.NET websites sends the version number as a HTTP header. For an ASP.NET 2.0 application this is added automatically to the headers and you cannot remove it from code. This is what it looks like:
X-AspNet-Version => 2.0.50727
For the problematic solution, we found out that the issue can be fixed if we add below line into machine.config file of the all 5 production servers.
But we have this line already setup for majority of the websites/pages under web.config file. Now it's really hard to keep track of everytime to add this line under web.config as soon as the new site or pages goes to production. So I was thinking to just
add this line under machine.config and forget about adding this line under web.config in future.
So now I want to make sure that if I add this line under machine.config file, what will happen with the same line already added under web.config for the majority of the sites? Will it cause any issue? OR I have to remove this line from web.config before
I add into machine.config? OR It doesn't matter if the same entry remains at both places (web.config and machine.config)?....
Jul 27, 2010 07:47 PM|Charith Gunasekara|LINK
You can override
Property in machine level while having the configuration property configured in application level
Jul 27, 2010 09:27 PM|jigkin21|LINK
Thank you so much for your help, Charith.