Results 1 to 2 of 2

Thread: Routing in ASP.Net 4 and IIS

Threaded View

  1. #1

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Routing in ASP.Net 4 and IIS

    I have implemented the solution applied below and when I run my website from visual studio 2010 it works fine, the routed requests all work perfectly.
    http://erraticdev.blogspot.com/2011/...module-to.html

    However once deployed to the server running on IIS7 the routing no longer seems to work and I end up with a 404 page not found error.

    I have web config set up as below.

    HTML Code:
     <httpModules>
          <add name="RegistratorModule" type="RegistratorModule"/>
        </httpModules>
    
        <httpRuntime requestValidationMode="2.0"/>
    	</system.web>
    And I have changed the application pool to classic mode. I have also stopped and started the application pool.

    Anyone got any ideas what else I could do to try get this working on the server?

    I am not sure that the custom module is running when the web server is started, I put the following code in my route mapping method and nothing is getting written to the log.

    Code:
     string sSource;
            string sLog;
            string sEvent;
    
            sSource = "Registering Routes";
            sLog = "Application";
            sEvent = "GSP Event";
    
            if (!EventLog.SourceExists(sSource))
                EventLog.CreateEventSource(sSource, sLog);
    
            EventLog.WriteEntry(sSource, sEvent);
            EventLog.WriteEntry(sSource, sEvent,
                EventLogEntryType.Warning, 234);

    More strangely if I change the IIS application pool mode to integrated
    and register the module as below I get Event code: 4010
    Event message: An unhandled security exception has occurred.


    Code:
     <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
          <modules>
            <add name="RegistratorModule" type="RegistratorModule"/>
          </modules>
    Last edited by FishGuy; Mar 10th, 2011 at 10:17 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width