EFPower tool 使用时发生的异常

本文讨论了在使用 EF Power Tool 时遇到的数据库连接异常问题,包括异常信息解析、解决方法以及避免密码保存方式不当导致的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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 就没有办法连接数据库。

Line 6524: 10-23 14:33:56.475 26964 26964 I AEE_AEDV: Line 6525: 10-23 14:33:56.475 26964 26964 I AEE_AEDV: Line 6526: 10-23 14:33:56.475 26964 26964 I AEE_AEDV: ELM r/wlat:PASS Line 6527: 10-23 14:33:56.475 26964 26964 I AEE_AEDV: AP detect MDEE time:25221.780195 Line 6528: 10-23 14:33:56.475 26964 26964 I AEE_AEDV: MD:unlwctg*MT6833_S00*MOLY.NR15.R3.MP.V137.4.P14*2024/08/30 15:15*TK_MD*NLWCG_MP_6833*Release Line 6529: 10-23 14:33:56.475 26964 26964 I AEE_AEDV: AP:unlwctg*MT6833*1d300000 (MD)1d300000 Line 6530: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: == EXTERNAL EXCEPTION LOG == Line 6531: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0xAB000005 0x0000000C 0x0055434D 0x00000000 Line 6532: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x01000000 0x50495355 0x53555F30 0x00305049 Line 6533: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x50495355 0x53555F31 0x00305049 0x50495355 Line 6534: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x53555F32 0x00315049 0x50495355 0x53555F33 Line 6535: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00315049 0x30514353 0x5143535F 0x00003631 Line 6536: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x31514353 0x5143535F 0x00003631 0x32514353 Line 6537: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x5143535F 0x00003631 0x33514353 0x5143535F Line 6538: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00003631 0x3233444D 0x4B41525F 0x00000045 Line 6539: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x4E4F534D 0x00304349 0x00000000 0x4E4F5356 Line 6540: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00304349 0x00000000 0x0100001D 0x000003DE Line 6541: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x0000001D 0x90937DA0 0x90937DEC 0xCCCCCCCC Line 6542: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0xCCCCCCCC 0x00000001 0x00000000 0x00006003 Line 6543: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x28C28F40 0x90937DA0 0x90937DEC 0x00000001 Line 6544: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00800074 0x00000000 0x00000000 0x00000000 Line 6545: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6546: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6547: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6548: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6549: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6550: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6551: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6552: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6553: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6554: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6555: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6556: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6557: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6558: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x0000000C 0xEE0007FF 0x32E24649 Line 6559: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0xEE0007FF 0x33102A8B 0xEE0007FF 0x32E2AE3C Line 6560: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0xEE0007EF 0x33307186 0xEE0007FF 0x32E24663 Line 6561: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0xEE0007FF 0x32E24663 0xEE0007FF 0x32E2464A Line 6562: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0xEE0007FF 0x32E2464D 0xEE0007FF 0x32E2464D Line 6563: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0xEE0007FF 0x32E2464C 0xEE0007FF 0x32E2464C Line 6564: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0xEE0007FF 0x32E2464C 0x00000000 0x00000280 Line 6565: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000400 0x01010000 0x01010101 0x01010101 Line 6566: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000101 0x00000000 0x00000000 0x00000000 Line 6567: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000000 0x00000000 0x00000000 0x00000000 Line 6568: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x00000680 0x00001488 0x000014E4 0x00001540 Line 6569: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x0000159C 0x000015F8 0x00001654 0x000016B0 Line 6570: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x0000170C 0x000017A8 0x0000180C 0x0000186C Line 6571: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x4F46415B 0x5F444E55 0x49474542 0x4C0A5D4E Line 6572: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x6C656261 0x4F4D203A 0x4E2E594C 0x2E353152 Line 6573: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x4D2E3352 0x31562E50 0x342E3733 0x3431502E Line 6574: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x5657530A 0x69737265 0x203A6E6F 0x3531524E Line 6575: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x2E33522E 0x5420504D 0x444D5F4B 0x574C4E20 Line 6576: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 0x4D5F4743 0x38365F50 0x420A3333 0x646 Line 6577: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: Core dump Info: Line 6578: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: path: /proc/aed/current-ee-coredump Line 6579: 10-23 14:33:56.477 26964 26964 I AEE_AEDV: 分析一下
最新发布
06-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值