title: Extension method requires "this" to call?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3510964/why-is-the-this-keyword-required-to-call-an-extension-method-from-within-the-e">Why is the &#39;this&#39; keyword required to call an extension method from within the extended class</a>  </p>
  </blockquote>
  
  
  
  <p>I have an extension method declared in an assembly under a certain namespace, it's a very common helper:</p>
  
  <pre><code>using System;
  
  namespace Common {
      public static class GenericServiceProvider {
          public static T GetService&lt;T&gt;(this IServiceProvider serviceProvider) {
               return (T)serviceProvider.GetService(typeof(T));
          }
      }
  }
  </code></pre>
  
  <p>Now in a different assembly and namespace, I'm trying to access this extension method from a class that implements IServiceProvider:</p>
  
  <pre><code>using System;
  using Common;
  
  namespace OtherNamespace {
      class Bar: IServiceProvider {
          void Foo() {
              GetService&lt;IMyService&gt;(); // doesn't compile
              this.GetService&lt;IMyService&gt;(); // compiles
          }
      }
  }
  </code></pre>
  
  <p>As you can see, I cannot call the generic extension method directly, it doesn't even show up in IntelliSense. However, if I add "this" before the call, it works fine.</p>
  
  <p>This is in Visual Studio 2010 using .NET 4.</p>
  
  <p>Is this normal or am I doing something wrong? Thanks.</p>