title: VB.NET Extension Methods
body: <p>when I apply the tag  above my methods I get the error </p>
  
  <blockquote>
    <p>Type System.Runtime.CompilerServices.Extension is not defined.</p>
  </blockquote>
  
  <p>Here is my sample</p>
  
  <pre><code>&lt;System.Runtime.CompilerServices.Extension()&gt; _
       Public Sub test()
  
  End Sub
  </code></pre>
  
  <p>Where am I going wrong?</p>
  
  <p>Edit ~ Straight from the MSDN Article <a href="http://msdn.microsoft.com/en-us/library/bb384936.aspx" rel="noreferrer">here</a>, the same error</p>
  
  <p><code></p>
  
  <pre>
  Imports System.Runtime.CompilerServices
  
  Module StringExtensions
       _
    Public Sub Print(ByVal aString As String)
          Console.WriteLine(aString)
      End Sub
  
  End Module
  
  </pre>
  
  <p></code></p>
  
  <p>I am using Visual Studio 2008 and 3.5 Framework in my project.</p>
  
  <blockquote>
    <p>Solution ~ The project was on 2.0 Framework. Changed to 3.5 and it works.</p>
  </blockquote>