我想首先使用PowerTools对代码进行逆向工程。当我从本地MS-SQL数据库进行逆向工程时,它可以工作,但不能从Oracle DB中进行。我在输出控制台中收到以下错误:
System.Data.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> Oracle.DataAccess.Client.OracleException: ORA-1005: null password given; logon denied
at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)
at Oracle.DataAccess.Client.OracleConnection.Open()
at Oracle.DataAccess.Client.EFOracleProviderServices.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, Version targetEntityFrameworkVersion)
at System.Data.Entity.Design.EntityStoreSchemaGenerator.CreateStoreSchemaConnection(String providerInvariantName, String connectionString, Version targetEntityFrameworkVersion)
at System.Data.Entity.Design.SsdlGenerator.EntityStoreSchemaGeneratorDatabaseSchemaLoader.CreateStoreSchemaConnection(String providerInvariantName, String connectionString, Version& storeSchemaModelVersion)
at System.Data.Entity.Design.EntityStoreSchemaGenerator..ctor(String providerInvariantName, String connectionString, String namespaceName)
at Microsoft.DbContextPackage.Handlers.ReverseEngineerCodeFirstHandler.ReverseEngineerCodeFirst(Project project)
我可以通过右键单击项目>来正常生成EF文件。添加> ADO.NET实体数据模型>从现有数据库中选择""并按照向导的其余部分。我更喜欢powertools,原因有几个(主要是映射为.cs文件)。使用Oracle时为什么不能进行逆向工程? TIA
答案 0 :(得分:4)
我不确定我是否完全理解......在您尝试生成文件之前,您似乎需要检查“记住密码”框。 (即使没有检查,测试也会恢复正常!)