I have a website where part is webforms (Umbraco CMS) and part is MVC. This is the HttpHandler for working with MVC functions:
public class Mvc : MvcHttpHandler { protected override void ProcessRequest(HttpContext httpContext) { httpContext.Trace.Write("Mvc.ashx", "Begin ProcessRequest"); string originalPath = httpContext.Request.Path; string newPath = httpContext.Request.QueryString["mvcRoute"]; if (string.IsNullOrEmpty(newPath)) newPath = "/"; httpContext.Trace.Write("Mvc.ashx", "newPath = "+newPath ); HttpContext.Current.RewritePath(newPath, false); base.ProcessRequest(HttpContext.Current); HttpContext.Current.RewritePath(originalPath, false); } }
Details on how this is implemented here. This method works well on the MVC 1.0 website. However, when I upgrade this site to MVC 2.0, following the instructions in the Microsoft Update Documentation ; everything compiles except at runtime. I get this exception:
Server error in application "/".
Resource is not found.
Description: HTTP 404. The resource you are looking for (or dependencies) might have been deleted, changed its name, or temporarily unavailable. please review the following URL and make sure it is spelled correctly.
Requested URL: /mvc.ashx
Version Information: Microsoft.NET Framework Version: 2.0.50727.4927; ASP.NET Version: 2.0.50727.4927
This resource and its dependencies are found in MVC 1.0, but not in MVC 2.0, is there an additional dependency that I will need to add? Is there something I'm missing? Are there any changes to MVC 2.0?
Myster
source share