This project is read-only.

Exception "The incoming request does not match any route."

Dec 28, 2008 at 8:59 AM
My configuration: Windows XP SP2, VSTS 2008, .NET 3.5 SP1, SQL Server 2008, IE7, no IIS
I used SSMS to manually attach the OxiteSite\App_Data\Oxite.Database.mdf and the log file, renamed it to "Oxite.Database", and then executed Oxite.Database\sql\Oxite.Database.sql in SQLCMD Mode successfully without any error. Then I modified OxiteSite\Web.config, set <add name="ApplicationServices" connectionString="Data Source=.;Initial Catalog=Oxite.Database;Persist Security Info=True;User ID=OxiteSite;Password=c9FTw!1"/>
Everything seems OK, but when I pressed F5 to debug OxiteSite in IE7, an exception "The incoming request does not match any route." thrown. The current url is "http://localhost:30913/", and it stops at Default.aspx.cs line 13:  httpHandler.ProcessRequest(HttpContext.Current);
Any idea?
Dec 28, 2008 at 9:10 AM
Just got the exact same error... if you deploy your site to a server somewhere and try to hit it the config section <oxite><server host=... > must point to the uri of your incoming request. I am deploying a staging environment on my server http://www.noop.se and so I had to put this value.

Hope this helps!

Cheers,

M.
Techie.notepad
Dec 28, 2008 at 11:47 AM
The config section was like:
<oxite>
    <site name="Oxite Sample" host="http://localhost:30913" .........>
And it threw the exception "The incoming request does not match any route."

Now I have changed it to "http://localhost:30913/"  , just one more "/" at the end, and another exception shows up "No site or redirect was found for 'http://localhost:30913'  "
Oxite.Mvc\OxiteApplication.cs    Line: 97 

Line 95:
Line 96:                 if (foundRedirect == null)
Line 97:                     throw new Exception(string.Format("No site or redirect was found for '{0}'", host));
Line 98:                 else
Line 99:                 {


P.S.: I used VSTS built-in web server, that is ASP.NET Development Server
Root URL:  http://localhost:30913/
Virtual Path: /
Phsical Path:  D:\Oxite\OxiteSite\
Dec 28, 2008 at 12:06 PM
Just now I reviewed the code of OxiteApplication.cs. If I set <site host="http://localhost:30913/">, it definitely will not work.

string host = string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port != 80 ? ":" + Request.Url.Port.ToString() : "");
// for me, host = 'http://localhost:30913'.   Host != host, so the block executes, and there's no redirects, so foundRedirect is always null, thus the exception is thrown.
if (string.Compare(Config.Site.Host, host, true) != 0)
{
    ISiteRedirect foundRedirect = null;

    foreach (ISiteRedirect redirect in Config.Site.Redirects)
    {
        if (string.Compare(redirect.Host, host, true) == 0)
        {
            foundRedirect = redirect;
            break;
        }
    }

    if (foundRedirect == null)
        throw new Exception(string.Format("No site or redirect was found for '{0}'", host));
    else

Dec 28, 2008 at 1:50 PM
Hey there!

Suddenly we get versioning issues I'm afraid. I don't have the error message you describe anywhere in my code and the code you paste does not match mine.

I'm sure I can help you but I need to know the version you are using! I've been haning on the new checkins and so I'm sure we don't share the same code.

M.
Techie.notepad
Dec 29, 2008 at 12:58 AM
The version I was using is 2008.12.5.
Just now I downloaded Dec. 19, oxite-27048. First I detached the old Oxite.Database in SSMS, and executed the script "oxite-27048\Oxite\Oxite.Database.sql" (41KB) to rebuild the Oxite.Database. Then I modified Web.config to this: (just commented the first connection string, and uncommented the second one. Because I'm using SQL Server 2008 Enterprise, so I crossed out the "\SQLEXPRESS")
    <connectionStrings>
        <!--<add name="ApplicationServices" connectionString="Data Source=.\SQLEXPRESS;AttachDBFileName=|DataDirectory|Oxite.Database.mdf;Integrated Security=true;User Instance=true;"/>-->
        <add name="ApplicationServices" connectionString="Data Source=.;Initial Catalog=Oxite.Database;Persist Security Info=True;User ID=OxiteSite;Password=c9FTw!1"/>
    </connectionStrings>
That's it. Nothing more modification has been done. Then I set the OxiteSite project as StartUp Project in VSTS 2008, and pressed F5 to debug it. The same exception comes out! "The incoming request does not match any route."

 

Server Error in '/' Application.

The incoming request does not match any route.

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.Web.HttpException: The incoming request does not match any route.

Source Error:

Line 11:             HttpContext.Current.RewritePath(Request.ApplicationPath);
Line 12:             IHttpHandler httpHandler = new MvcHttpHandler();
Line 13: httpHandler.ProcessRequest(HttpContext.Current);Line 14:         }
Line 15:     }

Source File: D:\Cache\oxite-27048\Oxite\OxiteSite\Default.aspx.cs    Line: 13

Stack Trace:

[HttpException (0x80004005): The incoming request does not match any route.]
   System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContextBase httpContext) +15589
   System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContext httpContext) +40
   System.Web.Routing.UrlRoutingHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +7
   OxiteSite._Default.Page_Load(Object sender, EventArgs e) in D:\Cache\oxite-27048\Oxite\OxiteSite\Default.aspx.cs:13
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
<!-- [HttpException]: The incoming request does not match any route. at System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContextBase httpContext) at System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContext httpContext) at System.Web.Routing.UrlRoutingHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) at OxiteSite._Default.Page_Load(Object sender, EventArgs e) in D:\Cache\oxite-27048\Oxite\OxiteSite\Default.aspx.cs:line 13 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\d060e82f\6c4ac2fa\App_Web_tajp9phm.0.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->
Dec 23, 2009 at 2:16 AM

I was getting this as well, however I found out that restarting the built-in asp.net server in VS fixed the issue.  To do this, right click on the icon in the systray, click on "Stop".  Then go back to VS, hit F5 and it works fine.

Dec 31, 2009 at 2:46 AM
Edited Dec 31, 2009 at 10:49 PM

hi, i got 2005.2.15 installed and got it up and running up to setup. after setup i get the same "The incoming request does not match any route." error from an HttpException. stopping dev iis instances doesn't work for me here. can someone post what worked for them? also tried to load oxite.aspx

i think i need to register route, like this: http://www.asp.net/learn/mvc/tutorial-08-cs.aspx, for my {controller}.aspx, but not sure where to apply this within this code. this is all i've had to add to other mvc projects, though. i would have to change a lot, and it seems that there has to be a better way. 

G-

Jan 29, 2010 at 9:11 PM

i went another round setting up oxite and this time i won... off the top of my head:

1) i used the source control version ("latest")
2) the app_data/.mdf file gave me a problem authenticating my user when i AttachDBFileName, so i used VS 2008 "Publish to Provider" to publish it to my sqlexpress 2008 instance (yes i am actually not that familiar with attachDBFileName devving like that) and then used a regular old connection string after assigning the permission. 
3) the connection strings used are in both web.config and oxite.config. make sure you check them. 

as you can see i was off in la-la-land thinking my problem was something else. hope this helps :) 

G-