Search code examples
c#mysqlentity-frameworkentity-framework-4

Schema specified is not valid. Errors: error 0002: Request failed


I have an EntityFramework project running off MySql that runs great locally as well as on a dedicated server, however I'm trying to move this project to HostGator and I'm receiving the following error:

Schema specified is not valid. Errors:
App_Code.WireWeld.ssdl(2,88) : error 0002: Request failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.MetadataException: Schema specified is not valid. Errors:
App_Code.WireWeld.ssdl(2,88) : error 0002: Request failed.

I know the database is correct as I can connect via Navicat and see its contents. I'm pretty sure the connection string is correct, I have the proper username and password.

I'm really stuck on this one and would appreciate any help possible.


Solution

  • If you are using more than one model in your project I advice you to have a look into that topic as it describes possible solutions to the problem.

    If you are not using multiple models than this looks like a file permission issue to me. Perhaps in the hosted environment, the account underwhich your application is running doesn't have access to where the metadata files are located? You should make sure you have permission (read/write are required). If this is not an option for you than the only go would be to embed the metadata in the assembly directly and use a res:// style connection string.