指定的架构无效。错误:错误0002:请求失败

时间:2012-02-17 15:46:51

标签: c# mysql entity-framework entity-framework-4

我有一个运行MySql的EntityFramework项目,该项目在本地以及专用服务器上运行良好,但是我正在尝试将此项目移动到HostGator并且我收到以下错误:

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连接并查看其内容。我很确定连接字符串是正确的,我有正确的用户名和密码。

我真的很喜欢这个,并希望得到任何可能的帮助。

2 个答案:

答案 0 :(得分:2)

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

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

答案 1 :(得分:0)

如果您使用SQL server并有2个项目-一个是类库,而第二个则在主项目中使用该类库,则将这两个dll从类库项目放置到主项目引用中。

1-EntityFramework.dll

2-{{​​1}}