Question

I have successfully created a ASP.NET MVC 4 Web application and now I want to deploy it on a test environment. The target server is not an Azure server, but it is a Windows Server 2008 R2 Server with IIS installed in it. Now I have published my solution using Visual Studio 2013 Professional, everything works fine excepts the Database. It's a Mysql Database that works perfectly with Entity Framework 5 (I have added the Mysql provider, mysql.data.entity.dll , mysql.data.dll on my web project and all the configuration to make it run locally). Once I publish the project, it is deployed on IIS but it doesn't retrieve data from my Mysql Database. I want to notice also that in the Publish wizard, although I specified the connection string, it says that

there is no Database detected

It should display the name of my context instead of that. Would you please help me know why the publishing wizard doesn't recognize my Mysql Database? thank you for your help !

No correct solution

OTHER TIPS

I was able to use Asp.net MVC with MySql using Entity Framework code first, like the one explained here http://www.asp.net/identity/overview/getting-started/aspnet-identity-using-mysql-storage-with-an-entityframework-mysql-provider ... Here a couple the things I notice:

  • The generated migration contains the schema dbo. that won't work on MySql so I went to the migration file and remove all schema references. (there are better solutions, like configuration/setup wise)
  • The unique key length problem, such as UserName (defined in the asp.net Identity) has a maximum length of 256 and that is over the limitations of mysql unique field, so I changed the length to 128. that solved this error

Specified key was too long; max key length is 767 bytes

  • I did have some troubles using the publishing wizard, since didn't show me any of my MySql Drivers to test my connection to my db, so I just change the Connection string in the config file and apply my migration changes to the new/testing DB from the Package Manager Console > Update-Database (this could be your temporary solution until you find a automatized solution)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top