Server Error in '/' Application.
--------------------------------------------------------------------------------
No parameterless constructor defined for this object.
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.MissingMethodException: No parameterless constructor defined for this object.
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: }
我在看史蒂芬·桑德森的“Pro ASP.NET MVC Framework”一书。在132页,根据作者的建议,我下载了MVC程序集,并将其添加到我的ASP.NET项目中。注:这可能是一条转移注意力的鱼。
在此之后,我不能再加载我的项目。上面的错误让我吃了一惊。
我的问题是,而不是,“你能帮我修复我的代码吗?”
相反,我想知道更一般的情况:
似乎我应该比现在更深层次地理解路由和控制器。
https://stackoverflow.com/questions/1355464
复制相似问题