3

I have a class library I'm using to wrap the SQL Server Membership and Role provider API's. I attempted to test my first method in my MSTest unit test class, but I got the error, "The role manager feature has not been enabled".

I've added a couple different types of config files to the test project hoping that would wire up everything, but it doesn't seem to like it.

How do I wire up a config file with all the provider information to the test project properly?

2 Answers 2

4

I simply had to add the configuration items to an App.config file instead of a Web.config file. I had just moved all the provider elements over by copying the Web.config. I just copied/pasted into App.config in my test project instead and it worked just fine after that.

3

I stumbled here from google, for my asp.net web app I needed to enable roleManager in web.config, this sample is for using windows authentication/roles. Hope it helps someone else.

<authentication mode="Windows"/>
<identity impersonate="true" />
<roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.