Cannot attach the file ‘{0}' as database '{1}'

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Cannot attach the file ‘{0}' as database '{1}'相关的知识,希望对你有一定的参考价值。

EF使用CodeFirst,当使用localDB时,删除mdf文件,会报“Cannot attach the file ‘{0}‘ as database ‘{1}‘”错误。

解决方法如下:

1、打开Visual Studio 命令提示

2、sqllocaldb.exe stop v11.0

3、sqllocaldb.exe delete v11.0

然后重新生成数据库文件即可

技术分享

以上是关于Cannot attach the file ‘{0}' as database '{1}'的主要内容,如果未能解决你的问题,请参考以下文章

Cannot attach the file ‘{0}' as database '{1}'

Cannot attach the file 'E:TeamWorkFidoFido.WebSiteApp_DataFidoData.mdf' as database 

pycharm the project at uses a non standard layout and cannot be attached to

The system cannot find the file specified

debug网页时小问题The source attachment does not contain the source for the file

How to attach multiple files in the Send Mail Task in SSIS