locked
web.conf for httpruntime RRS feed

  • Question

  • User1928221358 posted

    hello guys i have a problem regarding how to remove "X-AspNet-Version" in server response

    it tried to put <httpRuntime enableVersionHeader="false"/> on my web config, but it turns out an error

    i hope you could help me about my problem thanks and godbless

    Wednesday, September 17, 2014 2:29 AM

Answers

  • User2036689436 posted

    Sorry for replying to an old topic but I ran into the same issue and this is was the first google entry so I thought I'll post my solution since there is none

     Wink

    <system.web>
        <httpRuntime targetFramework="4.5" />
        <compilation debug="true" targetFramework="4.5"/>
        <httpRuntime enableVersionHeader="false"/>
    </system.web>


    I made the exact same mistake. You defined httpRuntime twice, merging them solved the issue for me. Hope this helps other people who land here aswell:

    <system.web>
        <httpRuntime enableVersionHeader="false" targetFramework="4.5" />
        <compilation debug="true" targetFramework="4.5"/>
    </system.web>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, May 13, 2017 12:37 AM

All replies

  • User-484054684 posted

    It should work. Reference: http://www.dotnetperls.com/x-aspnet-version

    What exact error you are getting when placing this in web.config file?

    Make sure you put this tag inside <system.web> section.

    There are two ways: Either use http runtime element, or use url rewrite module. For url rewrite rule: Please read this good article (last section): http://blogs.msdn.com/b/varunm/archive/2013/04/23/remove-unwanted-http-response-headers.aspx

    Wednesday, September 17, 2014 1:19 PM
  • User1928221358 posted

    hi shiva

    sorry for very late reply

    i already tried that instruction but it didnt work.

    here is the error code 

    HTTP Error 500.19 - Internal Server Error

    Friday, September 19, 2014 9:46 AM
  • User-484054684 posted

    Hi,

    No problem, this error code will be due to invalid configuration. Could you post the screenshot of the yellow page or, stack trace which points to the lines of webconfig on where exactly the error appears.

    There are many causes for this issue: Refer this good article: http://blogs.msdn.com/b/webtopics/archive/2010/03/08/troubleshooting-http-500-19-errors-in-iis-7.aspx

    Friday, September 19, 2014 10:02 AM
  • User1928221358 posted
    <configuration>
      <system.web.extensions>
        <scripting>
          <webServices>
            <jsonSerialization maxJsonLength="50000000" />
          </webServices>
        </scripting>
      </system.web.extensions>
        <system.web>
          <httpRuntime targetFramework="4.5" />
          <compilation debug="true" targetFramework="4.5"/>
          <httpRuntime enableVersionHeader="false"/>
        </system.web>
    
      <system.webServer>
        <httpProtocol>
          <customHeaders>
            <remove name="X-Powered-By" />
          </customHeaders>
        </httpProtocol>
      
      </system.webServer>
    
    </configuration>
    

    here is the sample web.conf  

    Friday, September 19, 2014 10:13 AM
  • User-484054684 posted

    Could you also post the yellow page error screenshot to get some clue?

    Friday, September 19, 2014 10:37 AM
  • User-166373564 posted

    Hi  auwi987,

    here is the error code 

    HTTP Error 500.19 - Internal Server Error

    This HTTP status code occurs because of a problem in the associated Applicationhost.config file or in the associated Web.config file. For more information, click the following article number to view the article in the Microsoft Knowledge Base: http://support2.microsoft.com/kb/942055 

    Please let me know if there is anything that I can do to help.

    Best regards,

    Angie 

    Saturday, September 27, 2014 2:22 AM
  • User2036689436 posted

    Sorry for replying to an old topic but I ran into the same issue and this is was the first google entry so I thought I'll post my solution since there is none

     Wink

    <system.web>
        <httpRuntime targetFramework="4.5" />
        <compilation debug="true" targetFramework="4.5"/>
        <httpRuntime enableVersionHeader="false"/>
    </system.web>


    I made the exact same mistake. You defined httpRuntime twice, merging them solved the issue for me. Hope this helps other people who land here aswell:

    <system.web>
        <httpRuntime enableVersionHeader="false" targetFramework="4.5" />
        <compilation debug="true" targetFramework="4.5"/>
    </system.web>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, May 13, 2017 12:37 AM