Asp.net mvc Ninject DI导致部署问题

Asp.net mvc Ninject DI导致部署问题,asp.net-mvc,deployment,ninject,asp.net-mvc-4,Asp.net Mvc,Deployment,Ninject,Asp.net Mvc 4,我正在尝试部署一个使用Ninject for DI的网站,该网站在我的开发机器上本地运行良好(难道它们都没有!)。 部署到主机(使用visual studio ftp发布选项)时,我会出现以下错误: Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)'. 及 查看堆栈跟踪,它显示为NinjectDependencyResolver。GetService(类型ser

我正在尝试部署一个使用Ninject for DI的网站,该网站在我的开发机器上本地运行良好(难道它们都没有!)。 部署到主机(使用visual studio ftp发布选项)时,我会出现以下错误:

Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)'.

查看堆栈跟踪,它显示为NinjectDependencyResolver。GetService(类型serviceType)是失败的方法。 正如我所说,它在本地运行得很好,所以我真的不知道在哪里或如何处理这个问题。谷歌搜索没有带来任何有用的东西

如果相关的话,我使用的是Ninject 3.0.1.10


编辑:我后来在homecontroller中添加了无参数构造函数,但没有任何区别,存在相同的错误。

我认为您是在.NET 4.5上构建并在.NET 4.0上部署,还是在.NET 4.0上部署.NET 4.5的Ninject

您是否将所有相关/所需的DLL copy local设置为true?听起来您缺少一些程序集。您确定服务器正在运行.NET 4吗?@Mystere Man:详细错误页面显示版本信息:Microsoft.NET Framework版本:4.0.30319;ASP.NET版本:4.0.30319。1@Tommy:我已将System.web.webhost、System.web.selfhost、System.web.data.helpers、System.web.data.entityframework、System.web.http.data、System.web.helpers和ninject.dll全部设置为复制always@LDJ-您正在使用Visual Studio 2012吗?是的,已将版本更改为4.0 et瞧!每次我遇到一个问题,过程都是一样的。谷歌=>stackoverflow=>Remo的答案=>success。
[InvalidOperationException: An error occurred when trying to create a controller of type 'Website.Controllers.HomeController'. Make sure that the controller has a parameterless public constructor.]