Question

I'm just starting with ASP.NET MVC and I was trying the Authentication with this new architecture.

So, I started following a tutorial in the official site and, while I was trying to add some users through the Web Site Administration Tool, I found this error:

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem: Could not load type 'MyMvcApp.MvcApplication'.

Now, the only thing I changed in the web.config was the connection string and, I'm sure the connection string is not the problem (is the same I'm using in other project).

EDIT: Here is the connection string: "Data Source=myMachine\SqlExpress;Initial Catalog=TestDB;User ID=TestUser;Password=123456"

I tried several things and googled a lot, but nothing worked.

So, any ideas? as I said, I did not change anything in the web.config besides the connection string.

Thanks in advance,

Was it helpful?

Solution

Found the problem: I just need to COMPILE the solution BEFORE starting the WSAT.

Thanks to everyone for your answers.

OTHER TIPS

Well, like the message says, this feature requires real management enabled, and the default MVC web site template has this disabled. Go into Web.config and change:

<roleManager enabled="false">

to

<roleManager enabled="true">

One other thing to check: Make sure that when you create the SQL Membership Provider metadata you connect as a user who will be useful at runtime. In other words, if you connect as sa, then the metadata will be in the dbo schema. But if you connect as yourself, then the metadata will be in your schema, which isn't necessarily useful to other applications. You should run SQL Server Management Studio in order to verify in which schema the metadata is placed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top