This page has moved or been replaced. The new page is located here:

Please update any bookmarks that point to the old page.

Download this Manual
User Comments
  Posted by Jeffrey Allen on October 22, 2010
Actually, in Visual Studio 2008 Professional Build Solution is Ctrl + Shift + B not F6
  Posted by Robert Gagnon on February 21, 2011
You may get a MySQLMembershipProvider incorrect schema error with the latest versions of MySQL (still in 5.5.9) which may be related to the error "Can't get hostname for your address". Bug has been introduced a few versions back where you cannot specify localhost or even an IP address or you will get the "hostname" error which may also embody itself as the incorrect schema error. Workaround is to set a resolvable domain name in the connection string for the server (can get a temporary domain from I had a fully functional website only to have these 2 related errors come up when upgrading from my 5.1.x install to 5.5.9.
  Posted by M Hunt on July 19, 2011
I'm using .NET 4.0 & in addition to following the tutorial I had to add the following to get it to work:

<membership defaultProvider="MySQLMembershipProvider">

Worked as expected after that.
  Posted by Danny Lents on February 8, 2012
Excellent article. Thanks!

I had to modify the directions slightly to work in my situation as follows:

Step 12: I had to start the Security Setup Wizard to see the Authentication Type screen.

Step 14: I clicked the Finish button on the Security Setup Wizard to exit the wizard. Then I clicked the Provider tab on the Web Site Administration Tool (WAT). However the MySQL references did not appear in the WAT.

I copied the MySQL configuration entries from my machine.config file to my web site web.config file and saved the web.config file. The MySQL options then appeared in the WAT.

Step 17: "Rebuild Solution" did not create the membership and role tables. I clicked the Build > Rebuild "Website" and that caused the tables to be created.

Outside of those few changes, the article worked perfectly for me. Thanks again.

  Posted by Joep Oude Veldhuis on September 3, 2013
With MySQL Connector/NET, Visual Studio 2012 and building an ASP.NET MVC 4 Web Application this tutorial doesn't work for me. Steps 14 to 16 have to be executed before step 11 or there will be an error on the security tab. After proceeding to step 22, the correct tables are created in the MySQL database. The roles I create on the Application tab of the Web Site Administration Tool do indeed turn up in the my_aspnet_roles table. So the connection with MySQL seems to work.

However, when I click on 'Create user', the following error is displayed:

"An error was encountered. Please return to the previous page and try again.
The following message may help in diagnosing the problem: Could not load file or assembly 'MySql.Web, Version=, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified. at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase)"

The correct references are present in the project and the correct version of MySql.Web.dll is in the .bin folder alongside MySql.Data.dll and MySql.Data.Entity.dll.

Can't figure this out, I'm stuck. If anyone has a solution for this or if anyone has a link to a complete and working tutorial for MySQL+VS2012+MVC4: please share!
  Posted by Don Dillard on October 18, 2013
I tried this with VS 2012 Express. .Net 4.0 & MVC 4 successfully.

I had the same problem the previous poster had with MySql.Web not loading on the create. Googling led me to,591183,591291#msg-591291

There's a bug in 6.7 versions mysql.web so bit the bullet and uninstalled it. Installed 6.6.6 and that worked. It also cleared up some other problems I was seeing.

Two tips.

To Find machine.config on your machine print out string
string s = System.Runtime.InteropServices.RuntimeEnvironment.SystemConfigurationFile; from a .net program.

Also Step 7 - finding ASP.NET Web Sie Administration Tool. It's located in the Project pulldown. Last Item.

Although this tutoial works, I could never get my MVC4 application to work. When trying to login or register, I never resolved an exception:
"Membership.Provider" property must be an instance of "ExtendedMembershipProvider"

It did work on the 2012 MVC3 Internet template. :)
  Posted by Jeff Wu on April 28, 2014
Use connector/net 6.8.3 to build a VS2012 + .Net Framework 4 + MVC4 Internet application. All the steps works normal. However, just like the previous comment, when I use the home page's Register to create a new user or use the already existed user to login(created on step 23 by WAT), an error message: "Membership.Provider" property must be an instance of "ExtendedMembershipProvider" pops up.
Sign Up Login You must be logged in to post a comment.