不支持關鍵字:“數據源”初始化實體框架上下文 - Keyword not supported: “data source” initializing Entity Framework Context

問題:

I'm initializing Entity Framework Object context, and this gives me the keyword not supported error:我正在初始化實體框架對象上下文,這給了我關鍵字不支持的錯誤:

metadata=res://*/MainDB.csdl|res://*/MainDB.ssdl|res://*/MainDB.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\\SQLEXPRESS;AttachDbFilename=D:\\Workspace\\vs\\Leftouch\\Leftouch.Web\\Data\\Leftouch.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;App=EntityFramework"

I took the connection string directly from web.config which was working, and modified only the path to the file (which I set dynamically), and instead of using the default value, used this connection string explicitly.我直接從正在工作的 web.config 中獲取連接字符串,並且只修改了文件的路徑(我動態設置的),而不是使用默認值,而是顯式使用了這個連接字符串。 What could cause this error?什麼可能導致此錯誤?


解決方案:

參考一: https://en.stackoom.com/question/TMFP
參考二: https://stackoom.com/question/TMFP
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章