首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >ASP.NET MVC:没有为此对象定义无参数构造函数

ASP.NET MVC:没有为此对象定义无参数构造函数
EN

Stack Overflow用户
提问于 2009-08-31 09:45:59
回答 27查看 280.1K关注 0票数 176
代码语言:javascript
复制
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项目中。注:这可能是一条转移注意力的鱼。

在此之后,我不能再加载我的项目。上面的错误让我吃了一惊。

我的问题是,而不是,“你能帮我修复我的代码吗?”

相反,我想知道更一般的情况:

  • 我应该如何解决此问题?
  • 我应该查找什么?
  • 根本原因是什么?

似乎我应该比现在更深层次地理解路由和控制器。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1355464

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档