How to remove X-AspNetMvc-Version from header response without touching source code file (Global.asax.cs)?

asp.net-mvc-4, c#

Solution

Set enableVersionHeader to false in your web.config is an alternate, I would prefer the web.config change to a handler solution like you have, obviously, since you will not need to access global.asax.cs to make the change:

just copy this line into the web.config’s `<system.web>` section:

<httpRuntime enableVersionHeader="false" />

http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.enableversionheader(v=vs.110).aspx

http://madskristensen.net/post/Remove-the-X-AspNet-Version-header

Problem

I need to disable the `X-AspNetMvc-Version` from the response header of a large number of applications. The server where the applications are hosted has just the content and config files `Global.asax, web.config, app.config` for the application and source code files (*.cs) reside with some other team. I could only find the solution as adding `MvcHandler.DisableMvcResponseHeader = true;` to `Global.asax.cs`. Any alternative solution(s) that involves working with any config file(s)?

Original source