Build/Test Issues

Membership Provider CreateUser not supported when running NCrunch

Started by thomen on 6,311 views

Hi Guys,
I have some legacy tests which create a user using the FormsAuthMembershipProvider

This all worked fine under NUnit but under NCrunch the CreateUser method isn't supported:
System.NotSupportedException : Specified method is not supported.
at System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status




Just wondering if there's a workaround I was thinking of wrapping and stubbing but just wanted to know if anyone else had experienced this.
Cheers,
Tom
Hi Tom,

Thanks for posting!

NCrunch itself doesn't have any knowledge of ASP.NET or its membership providers, so my suspicion is that this is a symptom of a much deeper problem - perhaps related to the .config file being applied to your test environment, or the assemblies it is referencing.

I recommend trying to deduct the source of the problem by looking for differences between the NUnit test environment and NCrunch. Specifically, check the following:
- Are both environments loading the same .config file? You can check the .config file being used by NCrunch by right clicking on the failed test, going to Advanced->Browse To Workspace, then looking for the ncrunchconfig file in the build output directory of the shadowed project NCrunch has used for the test run
- Are both environments using the same processor architecture and version of the .NET framework? You can often tell this by checking the list of loaded modules under a debug session
- Are both environments loading the same versions of the .NET framework assemblies? Again, the list of running modules can help you here
- If you browse to the .DLL NCrunch has built for your test project (using the Advanced->Browse To Workspace option), then try loading this DLL under NUnit, what kind of result do you get?

If you haven't already, it's also worth having a skim over the test troubleshooting guide to see if there's anything here that might be causing the deeper issue.


Cheers,

Remco

Post a reply

Log in to reply.