Change default location of LocalDb

后端 未结 1 639
长发绾君心
长发绾君心 2021-02-19 06:24

I am programming with EF5-code first and want to use LocalDb. How can I change the default location of LocalDb database file? Default location is %USERPROFILE% directory accordi

1条回答
  •  广开言路
    2021-02-19 06:53

    I got this working thanks to this post. The answer is simple. Basically I added

      
    
    

    to the configuration section of app.config and it magically replaced the "database" with my actuall database (DbContext) name. EF code first also works perfectly to create the database if it doesn't exist.

    0 讨论(0)
提交回复
热议问题