0

Im trying switch the Visual Studio asp.net mvc web app template to use MySql for user auth. So far iv installed mysql and .net connectors, created a custom membership provider (although it just throws notsupported atm) and edited the web.config to use them. But no matter what I try i just keep getting the following...

"Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed."

I've even searched the entire solution for any reference to sql to make sure its not set somewhere I was'nt expecting it too.

accompanying config is as follows...

<connectionStrings>
    <add name="MySqlMembershipConnection"
    connectionString="Data Source=server_name;
                      user id=username;
                      password=password;
                      database=database_name;"
    providerName="MySql.Data.MySqlClient"/>
</connectionStrings>

<membership>
      <providers>
        <add name="MySqlMembershipProvider" type="testmvcappp.MySqlMembershipProvider" />
      </providers>
<membership>

Thanks, Tom.

1

1 Answer 1

0

NOt sure, but a couple thoughts.

1) It's a generally good practice to call <clear/> in your providers list first to make sure that nothing was set in a "higher" web.config.

2) Is your custom membership provider inheriting from ProviderBase or from the SqlMembershipProvider? If the latter, it may be calling the inherited setup methods

Sign up to request clarification or add additional context in comments.

5 Comments

hey, my custom provider is inheriting from 'MembershipProvider'?
That should be fine. Do you have any of the other default stuff in the web.config still, perhaps? I mean, are you certain that none of the other services aren't registered w/ the default Sql implementations?
Yeee sorted it out :), the problem was i needed to explicitly remove the default provider <remove name="AspNetSqlProvider" />, seems a bit crazy to me but hey.
Right, my #1 was supposed to tell you to use the clear tag to dump all the default providers, but I only just noticed that I had used the regular &lt; instead of the html entity, so it got swallowed by Stack's input validation mechanism.
aaaaaah right ok :D cool, guess you did answer my question after all!

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.