Entry point was not found exception

前端 未结 12 772
夕颜
夕颜 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:24

    Old post but if you encounter it prior to the mvc woes (System.Mvc.dll update e.g x.0.0.1) you could check the bindingRedirect tag(4.0.0.0 -> 4.0.0.1)

    <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.1" />
      </dependentAssembly> 
    
    0 讨论(0)
  • 2020-12-10 01:27

    I faced this problem and solved it by
    1. uninstall-Package Microsoft.AspNet.Mvc (I need to uninstall something else before I can uninstall AspNet.MVC successfully)
    2. Install-Package Microsoft.AspNet.Mvc -Version 4.0.20710
    3. Rebuild and deploy

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

    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.

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

    Old post but just to add for anyone looking

    This seems like a catch all error. I got it when my web.config used an external section and that section was excluded from the Visual Studio project, i.e. using this

    <sessionState configSource="SystemWeb.config" />
    
    0 讨论(0)
  • 2020-12-10 01:29

    Just update "System.Web.Mvc" with "nuget"

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

    Do you have something like this in your Global.asax.cs?

    private static void InitializeDependencyInjectionContainer(HttpConfiguration config)
    {
        container = new UnityContainer();
    
    
        container.RegisterType<Site.Web.Data.IDatabaseFactory, Site.Web.Data.DatabaseFactory>();
        container.RegisterType<Site.Web.Data.Interfaces.IUnitOfWork, Site.Web.Data.UnitOfWork>();
        container.RegisterType<Site.Web.Data.Interfaces.IUserRepository, Site.Web.Data.Repositories.UserRepository>();
        container.RegisterType<Site.Web.Data.Interfaces.ISiteRepository, Site.Web.Data.Repositories.SiteRepository>();
    

    From the stack trace you posted System.Web.Mvc.IDependencyResolver.GetService(Type serviceType) +0 would suggest one (or more) of your dependencies don't resolve.

    You could try commenting one or more of them out and try to narrow down which one is failing to resolve.

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