2012-02-17 114 views
1

我有一個運行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

回答

2

如果您在項目中使用多個模型,我建議您查看that topic,因爲它描述了可能的解決方案。

如果您使用的不是多個模型,而且看起來像是文件權限問題。 也許在託管環境中,運行應用程序的帳戶無法訪問元數據文件所在的位置? 你應該確保你有權限(需要讀/寫)。如果這不是您的選擇,那麼只能直接將元數據嵌入到程序集中,並使用res://樣式連接字符串。

+0

嗨ScorpiAS - 感謝您的答案的問題。我沒有運行多個模型。我只是更新了app_code目錄權限而無濟於事。 – 99823 2012-02-17 16:05:27

+0

我有同樣的問題,我使用兩個模型,我的主題:http://stackoverflow.com/questions/23231089/metadataexception-due-to-connection-string,你能幫助我的鏈接是死的 – Chlebta 2014-04-23 09:17:12

相關問題