an exception occurred while initializing the database.

对于手动删除本地的LocalDB数据库之后出现标题所示异常的,推荐下面的命令:

sqllocaldb.exe stop v11.0

sqllocaldb.exe delete v11.0

在程序包管理器控制台或者Visual Studio自带的命令行工具执行都可以。

原文地址:https://www.cnblogs.com/s5689412/p/3600893.html