EF Power Tool 可以从数据库反向出Model,可是在使用的过程中出现了一个奇怪的问题,第一次是正常的,后来不知什么原因,总是提示异常。异常信息如下:

System.Data.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> System.InvalidOperationException: This operation requires a connection to the 'master' database. Unable to create a connection to the 'master' database because the original database connection has been opened and credentials have been removed from the connection string. Supply an unopened connection. ---> System.Data.SqlClient.SqlException: 用户 'sa' 登录失败。
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection sqlConnection, Action`1 act)
   at System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection, Action`1 act)
   --- End of inner exception stack trace ---
   at System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection, Action`1 act)
   at System.Data.SqlClient.SqlProviderServices.GetDbProviderManifestToken(DbConnection connection)
   at System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)
   --- End of inner exception stack trace ---
   at System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)
   at System.Data.Entity.Design.EntityStoreSchemaGenerator.GetProviderSchemaMetadataWorkspace(DbProviderServices providerServices, DbConnection providerConnection)
   at System.Data.Entity.Design.EntityStoreSchemaGenerator.CreateStoreSchemaConnection(String providerInvariantName, String connectionString)
   at System.Data.Entity.Design.EntityStoreSchemaGenerator..ctor(String providerInvariantName, String connectionString, String namespaceName)
   at Microsoft.DbContextPackage.Handlers.ReverseEngineerCodeFirstHandler.ReverseEngineerCodeFirst(Project project)

后来发现,在连接数据库时,连接字符串中,要确保Persist Security Info=True;

因为成功那次,我选择了保存密码,这样就把Persist Security Info的值设置为True了。如果这个值为false,就是不保存密码,EF power tool 就没有办法连接数据库。

EFPower tool 使用时发生的异常相关推荐

  1. ViewPager和SwipeRefreshLayout之间嵌套使用时发生事件冲突

    有时候我们会有一种需求,一个ViewPager有n个页面,每个页面是一个Fragment,在Fragment中使用了具有垂直滑动属性的控件,比如SwipeRefreshLayout!!! 这时二者之间 ...

  2. C3p0使用时出现的异常及解决方案

    当并发量大的时候,C3P0连接池会出现如下异常信息: Caused by: java.sql.SQLException: An attempt by a client to checkout a Co ...

  3. Mybatis使用时因jdbcType类型大小写书写不规范导致的异常

    Mybatis使用时因jdbcType类型大小写书写不规范导致的异常 参考文章: (1)Mybatis使用时因jdbcType类型大小写书写不规范导致的异常 (2)https://www.cnblog ...

  4. easyexcel使用问题:使用时导出的excel文件损坏,打开不了,后台没异常错误

    错误问题:使用时导出的excel文件损坏,打开不了,后台没异常错误 解决方式:因为前端使用的是blob,最后定位错误在前端发送请求时漏了一个参数, responseType: 'blob' expor ...

  5. [VisionPro与C#]联合编程时,遇到的异常及处理(调用目标发生了异常,对象的当前状态使该操作无效)

    在进行visionPro与C#联合编程时,发生未经处理的异常,"调用目标发生了异常""对象的当前状态使该操作无效",但程序经过反复检查,逻辑上并没有错误. 后来 ...

  6. execjs使用时异常

    execjs使用时异常 参考文章: (1)execjs使用时异常 (2)https://www.cnblogs.com/pythonywy/p/11716296.html 备忘一下.

  7. stm32f103c8t6使用PB3和PB4做普通GPIO使用时发现异常

    在使用PB3和PB4做普通GPIO使用时,发现普通的GPIO初始化程序无法正常使用PB3和PB4,后经查阅资料,发现是因为PB3和PB4在默认情况下是做JTAG调试用的.如果需要将其当普通GPIO使用 ...

  8. window服务启动异常问题检查(本地计算机上的XXX服务启动后停止。某些服务在未由其它服务或程序使用时将自动停止)

    完全复制过来的博客:用C#写个windows服务,安装部署后去启动时,提示说"本地计算机上的XXX服务启动后停止.某些服务在未由其它服务或程序使用时将自动停止".咋整?: 度娘说不 ...

  9. PowerDesigner15使用时的十五个问题

    2019独角兽企业重金招聘Python工程师标准>>> 转载:http://www.cnblogs.com/netsql/archive/2010/05/28/1746586.htm ...

最新文章

  1. VS2010 自定义用户控件未出现在工具箱的解决方案
  2. 设置c#windows服务描述及允许服务与桌面交互的几种方法
  3. 华为成为全球领先的移动设备供应商
  4. [云炬创业基础笔记]第七张创业团队测试8
  5. dede:arclist 不能调用文章的副栏目或多个副栏目的解决方法
  6. QEMU 1.3 发布,模拟处理器
  7. memcached 相关
  8. 美将遣返庇护申请者至墨西哥 弱势人士有望豁免
  9. Delphi应用程序的调试(三)监视变量
  10. adaboost java_Adaboost的java实现 | 学步园
  11. python库--pandas--Series
  12. spss 通径分析_【使用SPSS线性回归实现通径分析的方法】【原创资源】
  13. python选股软件编写
  14. 带阵列卡的服务器如何装系统,带阵列卡的服务器能不能做ghost
  15. 1174 哥德巴赫猜想(每日学习)
  16. [BZOJ5109]大吉大利,晚上吃鸡!
  17. FPGA驱动mipi 光固化 4K屏
  18. android socket 推送服务版本
  19. 使用 Fiddler 进行小程序抓包
  20. 【《Real-Time Rendering 3rd》 提炼总结】(十二) 渲染管线优化方法论:从瓶颈定位到优化策略

热门文章

  1. gg修改器偏移量修改_烧饼修改器地址偏移计算器功能使用说明
  2. Caffeine - Caches - Eviction
  3. fdsafdsafdsafdsafdsa
  4. 如何处理多重共线性问题
  5. Guacamole会话记录屏幕录像
  6. android 中获取所有有效网卡和对应的IP地址
  7. win10下的edge如何打开ie的兼容性视图?
  8. 贪心算法-磁带最优存储问题
  9. Android中使用ExpandableListView实现微信通讯录界面(完善仿微信APP)
  10. 如果睡眠不足,我们的大脑会怎么样?