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.

Tom Riley
  • 1,701
  • 2
  • 21
  • 43
  • possible duplicate of [How do I setup ASP.NET MVC 2 with MySQL?](http://stackoverflow.com/questions/2512852/how-do-i-setup-asp-net-mvc-2-with-mysql) – Darin Dimitrov Feb 06 '11 at 13:49

1 Answers1

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

Paul
  • 35,689
  • 11
  • 93
  • 122
  • hey, my custom provider is inheriting from 'MembershipProvider'? – Tom Riley Feb 06 '11 at 14:32
  • 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? – Paul Feb 06 '11 at 16:14
  • Yeee sorted it out :), the problem was i needed to explicitly remove the default provider , seems a bit crazy to me but hey. – Tom Riley Feb 12 '11 at 14:12
  • 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 < instead of the html entity, so it got swallowed by Stack's input validation mechanism. – Paul Feb 14 '11 at 17:46
  • aaaaaah right ok :D cool, guess you did answer my question after all! – Tom Riley Feb 15 '11 at 13:30