Search code examples
asp.net-mvcdependency-injectionninjectsystem.reflection

Ninject causing "Method not found: System.Reflection.MethodInfo.CreateDelegate"


I'm attempting to deploy a website that uses Ninject for DI which works well locally on my development machine. When deployed to GoDaddy hosting, I get the following error:

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

I'm using MVC3 (4.0 Framework).


Solution

  • This error usually happens if you deploy a .NET Framework 4.5 build on a machine that has 4.0 installed or the other way round.