1

I'm currently using Visual Studio 2010 and have created a 'ASP.NET MVC 3 Web Application'.

I've changed the question from SQLite to MySQL for reasons pointed out by Darin.

So I've setup my MySQL database and configured the web.config as shown in this answer, however I get instant configuration error on this:

Parser Error Message: Could not load file or assembly 'MySql.Web, Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.

Line 78: type="MySql.Web.Security.MySQLRoleProvider, MySql.Web

Is this because the public key is wrong?

Thanks

Community
  • 1
  • 1
ingh.am
  • 25,981
  • 43
  • 130
  • 177
  • *The system cannot find the file specified*. Is there something not clear about the error message you would like to ask about? – Darin Dimitrov Mar 04 '11 at 14:26
  • But it does exist. I added it as a reference in the project and the only place where it's in the web config are from the stack overflow answer you provided earlier. – ingh.am Mar 04 '11 at 14:29
  • @ing0: how about some feedback on this? Did you use any suggestions below & what worked for you? – Forer Sep 23 '11 at 13:49

4 Answers4

1

You will need to write a custom membership provider which works with SQLite. Here's an example with MySQL. Also notice that SQLite is not intended to be used in a multithreaded environment such as ASP.NET.

Community
  • 1
  • 1
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • Thanks, because of the multithreading, would you suggest that I go with MySQL then? I can't use SQLServer annoyingly :( – ingh.am Mar 04 '11 at 10:55
  • Yes, I would suggest you going with some other database. – Darin Dimitrov Mar 04 '11 at 10:56
  • @ing0 have a look at sqlce4 http://blogs.msdn.com/b/sqlservercompact/archive/2011/01/12/microsoft-sql-server-compact-4-0-is-available-for-download.aspx – gideon Mar 19 '11 at 06:20
1

The file is there but versions don't match. Check if you are specifying the correct version for your MySql Connector. This solved the problem for me.

Change Version=6.2.2.0 to the one you are using wherever it applies.

JuanMa
  • 111
  • 4
0

Try this

<add name="ApplicationServices"
         connectionString="Data Source=|DataDirectory|sqlite.db;Version=3;"
         providerName="System.Data.SqLite" />

If you need sqlite membership provider look here:

http://www.codeproject.com/KB/aspnet/SQLiteProviders.aspx

Richard
  • 21,728
  • 13
  • 62
  • 101
0

What version of the MySQL connector do you have installed? I saw that error message when I had mismatched the version numbers, and it went away when I corrected them. You can check the version by looking at the properties of the item in the references section.

Once that's working, you may also need to add a default membership provider. All you need to do is change <membership> to <membership defaultProvider="MySqlMembershipProvider">.

I also followed the instructions here which added a bunch of tables to the specified database related to membership, profiles, and roles. Not sure if that was required, but something to try if you're still running into issues.

Hope this helps!

Mike O'Connor
  • 3,813
  • 24
  • 27