Garbage characters when I deploy

Oct 14, 2010 at 2:04 PM

When I deploy the site either to my local IIS (Project -> Publish), or to my hosting company, I get garbage characters when running the application.  Do bear in mind that I have upgraded the application to run ASP.NET MVC 2 and .NET 4.0 (I had to make some minor code changes to achieve this, but I don't think that is causing the application to not show anything at all except garbage characters.  Could this have to do with encoding?

Oct 14, 2010 at 2:14 PM

It's hard to know what happends in the blind, since I don't know the website configuration but I can guess is that a handler for the default.aspx document is not specified.

Add the following line in the web.config, inside the element httpHandlers: <add verb="*" path="Default.aspx" type="System.Web.UI.PageHandlerFactory" />


I hope it helps,

Kind Regards,


Oct 14, 2010 at 5:12 PM

Actually I have that line already (I haven't modified anything from the original install), however it is failing on this line in default.aspx.cs:


I stepped into StringRoute.cs and it never finds a route.

It fails with:  "The incoming request does not match any route."


This only happens when I run on IIS and not in Cassini.  I am running IIS7 .NET 4.0 in integrated pipeline mode.

Oct 15, 2010 at 9:43 AM


If you are executing in integrated pipeline, you should copy the modules and handlers (from the section system.web) to the system.webServer section of the web.config file.

Look at and, if you want to execute it on integrated pipeline or switch to classic mode and it will work.

Hope it helps,

Kind Regards,


Oct 15, 2010 at 2:07 PM

Thanks I'll look at that.  However I tried switching to classic mode and still get this error:


Server Error in '/NearForums.Web.UI' 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 16:           HttpContext.Current.RewritePath(Request.ApplicationPath, false);
Line 17:           IHttpHandler httpHandler = new MvcHttpHandler();
Line 18:           httpHandler.ProcessRequest(HttpContext.Current);
Line 19:           HttpContext.Current.RewritePath(originalPath, false);
Line 20: 		}