title: asp.net 4 Membership.CreateUser reference required to assembly error
body: <p>new to .net so still learning....I have managed to get ASP.NET Membership mainly working with my SQL server.</p>
  
  <p>The problem i'm having is I get an error in VS2010 in my code behind file when attempting to create a user. I get a Red Exclamation mark appear on .CreateUser on the code below.</p>
  
  <p>Error Message:</p>
  
  <pre><code>Reference required to assembly 'System.Web.Security.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e65' containing the type 'System.Web.Security.MembershipUser'. Add one to your project.
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
      Try
          Membership.CreateUser(r_user_name.Text, r_password.Text)
          Label1.Text = "User created"
  
          'Response.Redirect("default.aspx")
  
      Catch ex As Exception
          Label1.Text = "Error"
      End Try
  </code></pre>
  
  <p>I've tried adding the following to the web.config:</p>
  
  <p>
  
  </p>
  
  <p>Not sure if thats correct!! but i get an error message when I open the page:</p>
  
  <p>Parser Error Message: <code>Could not load file or assembly 'System.Web.Security.MembershipUser\, System.Web.ApplicationServices\, Version\=4.0.0.0\, Culture\=neutral\, PublicKeyToken\=31bf3856ad364e65' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)</code></p>
  
  <p>Thanks for any help.</p>
  
  <p>J.</p>