locked
Website runs on working on IIS on localhost browser but error when when url used RRS feed

  • Question

  • User-341994687 posted

    Hi, 

    I have a website that runs on the iis when I use the browser on the localhost. So I enter Http://localhost/    and the site comes up fine. But when I use the url for the site I get an error 

    The given key was not present in the dictionary.
    
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
    
    Source Error: 
    
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    
    Stack Trace: 
    
    
    [KeyNotFoundException: The given key was not present in the dictionary.]
       System.Collections.Generic.Dictionary`2.get_Item(TKey key) +3814773
       PanelGroup_home.Page_Load(Object sender, EventArgs e) +307
       System.Web.UI.Control.OnLoad(EventArgs e) +92
       System.Web.UI.Control.LoadRecursive() +54
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

    Any help would be really appreciated because I am starting to go mad. 

    Best regards, 

         Seamus 

    Monday, April 14, 2014 6:37 AM

Answers

  • User364480375 posted

    try to add in web.config file

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
    </system.webServer>
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 15, 2014 5:41 AM

All replies

  • User364480375 posted

    try to add in web.config file

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
    </system.webServer>
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 15, 2014 5:41 AM
  • User-166373564 posted

    Hi seamus

    seamus1982

    I enter Http://localhost/    and the site comes up fine. But when I use the url for the site I get an error 

    Does our community member's solution help you fix it?

    On pages that have rewritten url, normally not all managed modules are executed (no Authentication etc.). If the dictionary that is accessed would be filled from such a module (like HttpContext.Current.User, which is set in that way too and would be null without that setting). So it's recommended to add the code above to your web.config configuration section.

    Moreover, you could also look into the log file in IIS, check whether it can give some hints why this happens.

    Best regards

    Angie

    Monday, April 21, 2014 9:46 PM