asp.net - System.EntryPointNotFoundException MVC5

标签 asp.net .net asp.net-mvc unity-container

我的网站在 Visual Studio 中运行良好,但一旦将其部署到 IIS,就会出现以下错误。

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.DependencyResolver.InnerSetResolver(IDependencyResolver resolver) +289
   Rabobank.Risk.LicwidWorkflow.UI.UnityConfig.RegisterComponents() +125
   Rabobank.Risk.LicwidWorkflow.UI.MvcApplication.Application_Start() +30

[HttpException (0x80004005): Entry point was not found.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12602733
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

[HttpException (0x80004005): Entry point was not found.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12619780
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12459397

我不知道为什么会这样。任何指针将不胜感激

最佳答案

这通常在使用依赖注入(inject)时发生。
如果您有多个相互引用的项目,请确保它们以相同的框架或兼容的框架为目标。还要检查所有 package.config 文件并确保每个 xml 行的 targetFramework 与您的项目目标框架匹配。

关于asp.net - System.EntryPointNotFoundException MVC5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37198596/

相关文章:

c# - StreamReader C# - 只读取特定行

c# - 我可以将 Stream 对象转换为 FileInfo 对象吗?

c# - 使用 Html.Raw 将 ASP.NET 模型序列化为 JSON 时出现 Razor 语法错误

javascript - 在ASP.NET MVC服务器端代码中动态创建和缩小JavaScript

.net - 在 Entity Framework 代码优先中恢复数据库

c# - 如何同步等待取消异步任务

c# - 服务仅在调试时工作

asp.net - IItemTransform 和现有的缩小文件

c# - 将具有依赖项 v1 的项目添加到具有依赖项 v1.1 的项目

.net - 如何指定要从表达式树方法返回的对象?