Author: PMichaud | Posted on: 6/3/2008 9:18:55 AM | Views : 555

I'm trying to unit test my custom providers with nunit, and I'm hitting some difficulty. In my role provider test suite, I have some user related tests, like the GetRolesForUser method. My  strategy is to create a new MembershipUser using the membershipprovider.CreateUser, then create a new role, then add the user to the role, then GetRolesForUser and determine if the method worked.
 
Before I get anywhere near there, my CreateUser method call to the other provider fails.  The Exception is:
 
Company.Testing.RoleProvider.AddUsersToRoles:
System.TypeLoadException : Could not load type 'Company.Providers.SqlMembershipProvider' from assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

 
This happens on the line where I attempt to instantiate a new MembershipUser. How can I get this MembershipUser without System.Web complaining?
 
edit: Go to the complete details ...