views:

880

answers:

3

Hi I use VS2010 B2 and .Net 4.0 in my project. I want to customize a MembershipProvider but i can't find this class in Vs2010. Guide me please.

A: 

There is an reference not set oder an Missing using Namespace is System.Web.Security

for more info checkt out MSDN

Andreas Hoffmann
Thanks Andreas for attention.i set refrence to System.Web.Security namespace but i can't inherit my Class from MembershipProvider.
mSafdel
what compiler message do you recive?
Andreas Hoffmann
You should post some sample code as the MembershipProvider class is abstract and must be inherited from so I assume you may be going wrong somewhere else?
James
I do these steps:•Create a Class Library project•Added System.Web refrence to project•Added a class to project. this class renamed to "SIAMembershipProvider.cs"•Added "using System.Web.Security;" to top of the class•Added this code:namespace SIA.Asp.Net.Membership { public class SIAMembershipProvider : MembershipProvider {}}
mSafdel
Did you override all Methodes in den class?
Andreas Hoffmann
+7  A: 

Interesting. However, build errors are your friend ;)

Attempting to build a class library built as you describe, I get the following build error:

The type name 'MembershipProvider' could not be found. This type has been forwarded to assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.

Following the instructions (adding a reference to System.Web.ApplicationServices) allows me to carry on as expected.

Zhaph - Ben Duguid
MembershipProvider don't exist in VisualStudio 2010! Can you do it?
mSafdel
Sorry, see my updated answer.
Zhaph - Ben Duguid
Thanks Zhaph-Ben Duguid
mSafdel
No problem, glad to help :)
Zhaph - Ben Duguid
This is also needed when upgrading a project where membership provider is being used.
Dustin Laine
A: 

Thanks for your note. It helped me a lot.

nalini