472,146 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

Unit testing MembershipProvider

Hello,

I'm trying to unit test an asp.net application. We are using the .net 2..0
authentication / loginView, etc. web controls, with a customized
MembershipProvider (MP) class to connect to an Oracle database. NUnit is
our unit testing framework, and I want to test the creation of a user in
the database.

NUnit loads the web.config file just fine, and can connect to the database
using configuration settings. I can initialize the custom MP, but when I
call CreateUser, it fails when calling the constructor for the .NET
MembershipUser object. The error is that it cannot load the custom
membership provider from this internal .NET class, even though I am using
the same assembly in my code. The specific error:

Membership creation threw an exception: Could not load type
'XXX.XXX.OracleMembershipProvider' from assembly 'System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'..
----System.TypeLoadException : Could not load type
'XXX.XXX.OracleMembershipProvider' from assembly 'System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'..

Why is this failing? The error seems to indicate that the assembly can't
be found, but I'm using the fully qualified class name including our
custom namespace. Is there some hard-coded dependency on a running
asp.net instance? Is there any other way for me to call this CreateUser
function without needing an asp.net instance?

thanks,
Cooper Blake
Oct 13 '06 #1
0 1488

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Hugh Cowan | last post: by
11 posts views Thread by rhat | last post: by
14 posts views Thread by | last post: by
4 posts views Thread by Peter Rilling | last post: by
72 posts views Thread by Jacob | last post: by
4 posts views Thread by Dat AU DUONG | last post: by
176 posts views Thread by nw | last post: by
48 posts views Thread by Ark Khasin | last post: by
5 posts views Thread by Ben Finney | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.