首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未发现异常入口点

未发现异常入口点
EN

Stack Overflow用户
提问于 2012-10-31 08:52:57
回答 12查看 39.2K关注 0票数 30

我安装了vs2012 (11.0.50727.1)

我打开了一个新的MVC4 with .NET 4.5解决方案,

我创建了一个简单的HomeController,由于我想在本地启动它,我收到了一个非常奇怪的错误:

如何解决这个问题?这个错误是什么?为什么会发生?

谢谢您的任何帮助。

代码语言:javascript
复制
    Server Error in '/' Application.
Entry point was not found.
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.EntryPointNotFoundException: Entry point was not found.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[EntryPointNotFoundException: Entry point was not found.]
   System.Web.Mvc.IDependencyResolver.GetService(Type serviceType) +0
   System.Web.Mvc.DependencyResolverExtensions.GetService(IDependencyResolver resolver) +56
   System.Web.Mvc.SingleServiceResolver`1.GetValueFromResolver() +44
   System.Lazy`1.CreateValue() +180
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +22
   System.Lazy`1.get_Value() +10749357
   System.Web.Mvc.SingleServiceResolver`1.get_Current() +15
   System.Web.Mvc.MvcRouteHandler.GetSessionStateBehavior(RequestContext requestContext) +121
   System.Web.Mvc.MvcRouteHandler.GetHttpHandler(RequestContext requestContext) +33
   System.Web.Mvc.MvcRouteHandler.System.Web.Routing.IRouteHandler.GetHttpHandler(RequestContext requestContext) +10
   System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +9709656
   System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e) +82
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929 
EN

回答 12

Stack Overflow用户

回答已采纳

发布于 2013-02-19 11:04:24

当您将项目从MVC3切换到MVC4并忘记在web.config中将System.Web.WebPages.Razor, Version=1.0.0.0更改为System.Web.WebPages.Razor, Version=2.0.0.0时,也会出现相同的错误。

票数 23
EN

Stack Overflow用户

发布于 2013-04-01 16:38:38

我已经将项目从MVC3+.NET4转换为MVC4+.NET4.5,并在调用控制器操作时接收异常Entry point was not found

我的解决方案是在web.config中插入重定向到MVC 4程序集的程序集绑定:

代码语言:javascript
复制
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

我不知道问题的确切原因,也许是一些仍然引用MVC3的第三方库。

票数 24
EN

Stack Overflow用户

发布于 2014-11-12 14:56:09

旧帖子,但如果您在mvc问题之前遇到它(System.Mvc.dll更新,例如x.0.0.1),您可以检查bindingRedirect标记(4.0.0.0 -> 4.0.0.1)

代码语言:javascript
复制
<dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.1" />
  </dependentAssembly> 
票数 11
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13154241

复制
相关文章

相似问题

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