Monday, April 4, 2011

.NET MembershipProvider with MySQL

If you're a .NET developer (Mono or MS, doesn't matter) and an OSS enthusiast, then you're probably using the MembershipProvider provided by MySQL instead of the default MS provider for MS-SQL. The MySQL MembershipProvider comes bundled within the MySQL Connector for .NET.


In certain configurations, one can expect various bugs related to the MySQL Connector, especially with the latest version of MySQL Server and/or Windows and/or IIS. The most annoying thing about such bugs is that they don't introduce themselves on a development machine (different web-server, different OS, etc.).

My latest bug involved getting NULL for Membership.GetUser calls, even for logged in users. The bug  would occur inconsistently, which made stuff quite hard to debug.
The solution? simple - always use the latest version of the MySQL Connector.

This is why I always plan the first-time production deployment to take a few days. You can never tell what will go wrong.

No comments:

Post a Comment

Post a Comment