title: Getting 'Error binding to target method.' for Delegate.CreateDelegate() in MVC application
body: <p>I have a custom action filter in MVC3 application</p>
  
  <pre><code>public class CustomActionFilter:ActionFilterAttribute
      {
          public Func&lt;IDictionary&lt;string, object&gt;, bool&gt; AdditionalCheck { get; set; }
  
          public CustomActionFilter()
          {
  
          }
  
          public CustomActionFilter(Type declaringType, string methodName)
          {
              MethodInfo method = declaringType.GetMethod(methodName);
              AdditionalCheck = (Func&lt;IDictionary&lt;string, object&gt;, bool&gt;)Delegate.CreateDelegate(typeof(Func&lt;IDictionary&lt;string, object&gt;, bool&gt;), method);
  
          }
      }
  </code></pre>
  
  <p>I want to use this as addition check that can be provided on an Action. The problem is it throws '<strong>Error binding to target method</strong>'. I created a console application and it was able to create the delegate. Is this a problem in web projects?</p>
  
  <p>I also tried:</p>
  
  <pre><code>AdditionalCheck = (Func&lt;IDictionary&lt;string, object&gt;, bool&gt;)Func&lt;IDictionary&lt;string, object&gt;, bool&gt;.CreateDelegate(typeof(Func&lt;IDictionary&lt;string, object&gt;, bool&gt;), method);
  </code></pre>
  
  <p>Already gone through the similar questions <a href="https://stackoverflow.com/questions/17026259/error-binding-to-target-method">here</a> <a href="https://stackoverflow.com/questions/12939108/why-do-i-get-this-error-binding-to-target-method-using-delegate-createdelegate">here</a></p>