Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entry point was not found exception

I have installed vs2012 (11.0.50727.1),
I opened a new MVC4 with .NET 4.5 solution,
i create a simple HomeController and as I've wanted to start it locally, i have received this very strange error:
How can resolve it? What is this error and why it's happens???

Thank you in advance, for any of your help.

    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  
like image 742
hackp0int Avatar asked Oct 31 '12 08:10

hackp0int


People also ask

What does Windows entry point not found mean?

Entry Point Not Found is an error that indicates that there is a missing or corrupted file within a particular process, which results in the program's inability to launch. If the missing or damaged component comes from Windows operating system you should be able to fix it using below steps.

Could Not find entry point for DLL?

When you see the error message reading “Entry Point Not Found,” that means your OS has no access to the game so it won't start. Usually this problem is triggered by a faulty DLL file that plays an essential role in the startup process of the game.


2 Answers

I have converted a project from MVC3+.NET4 to MVC4+.NET4.5 and I receive the exception Entry point was not found when invoking a controller's action.

My solution was to insert an assembly binding redirect inside web.config to point at MVC 4 assemblies:

  <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> 

I don't know the exact cause of the problem, maybe some third party library that still references MVC3.

like image 174
Davide Icardi Avatar answered Oct 02 '22 09:10

Davide Icardi


The same error appears when you switch you project from MVC3 to MVC4 and forget to change System.Web.WebPages.Razor, Version=1.0.0.0 to System.Web.WebPages.Razor, Version=2.0.0.0 in the web.config.

like image 45
Denis Avatar answered Oct 02 '22 07:10

Denis