指定的模式无效。错误:错误0002:请求失败

问题描述:

我有一个运行MySql的EntityFramework项目,它在本地以及专用服务器上运行良好,但是我试图将此项目移动到HostGator,并且收到以下错误:指定的模式无效。错误:错误0002:请求失败

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. 

我知道数据库是正确的,因为我可以通过Navicat连接并查看其内容。我很确定连接字符串是正确的,我有正确的用户名和密码。

我真的被困在这一个,并希望任何可能的帮助。

+0

是否有可能您的项目中有多个模型?这通常会导致与实体框架 – ScorpiAS 2012-02-17 15:54:36

如果您在项目中使用多个模型,我建议您查看that topic,因为它描述了可能的解决方案。

如果您使用的不是多个模型,而且看起来像是文件权限问题。 也许在托管环境中,运行应用程序的帐户无法访问元数据文件所在的位置? 你应该确保你有权限(需要读/写)。如果这不是您的选择,那么只能直接将元数据嵌入到程序集中,并使用res://样式连接字符串。

+0

嗨ScorpiAS - 感谢您的答案的问题。我没有运行多个模型。我只是更新了app_code目录权限而无济于事。 – 99823 2012-02-17 16:05:27

+0

我有同样的问题,我使用两个模型,我的主题:http://*.com/questions/23231089/metadataexception-due-to-connection-string,你能帮助我的链接是死的 – Chlebta 2014-04-23 09:17:12