Entry point was not found exception

前端 未结 12 771
夕颜
夕颜 2020-12-10 00:47

I have installed vs2012 (11.0.50727.1),
I opened a new MVC4 with .NET 4.5 solution,
i create a simple HomeControl

相关标签:
12条回答
  • 2020-12-10 01:06

    Try this.. in visual studio go to Package Administrator Console and type:

    update-package
    
    0 讨论(0)
  • 2020-12-10 01:08

    you should also check that all of the projects in your solutions reference the latest versions of the dll's, and that there are no inconsistent versions being used by different sub-projects.

    despite running nuget uninstall, install and update I found the tests project was referencing an old version of the system.net.http

    0 讨论(0)
  • 2020-12-10 01:10

    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.

    0 讨论(0)
  • 2020-12-10 01:17

    If you are catching this error in WebAPI Controller - you need fix binding version of System.Web.Http

    <dependentAssembly>
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
    </dependentAssembly>
    
    0 讨论(0)
  • 2020-12-10 01:22

    If you are using .net 4.5 and adding a binder to ModelBinders.Binders collection from a .net 4.0 library you will also get such error.

    0 讨论(0)
  • 2020-12-10 01:23

    Not MVC specific in my case, but had just started getting this error:

    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.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8008

    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0

    What caused that was that I had published to the webserver folder from Visual Studio and selected to Precompile the app (using a .NET 4.5 project), with allow precompiled site to be updateable setting btw.

    Probably my issue was that the site is running at .NET 4.0 on IIS, whereas the precompiled version placed in bin folder during the publish action was for 4.5. When I removed the "bin" folder from the website it run fine again.

    0 讨论(0)
提交回复
热议问题