SQL Server CE Code First migrations problems

守給你的承諾、 提交于 2019-12-04 04:51:41

So the problem was that the solution created a separate .sdf file here:

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Logo.sdf"

Which was unexpected and strange IMHO...

I ended up using this connection string:

<add name="LogoContext" connectionString="Data Source=|DataDirectory|\Logo.sdf" providerName="System.Data.SqlServerCE.4.0"/>

This references bin/Debug/Logo.sdf and it works during development and when running a .exe separately.

The only thing with this way is that my Logo.sdf project file (which was getting copied to Debug "if newer") is now completely ignored. All the migrations will be run on the Debug file.. That's probably good too....

Thanx Erik for the hint! david

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!