不支持关键字:“数据源”初始化实体框架上下文 - 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章