Skip to content

ef core db first 生成 entity 失败 #8

@ignite-404

Description

@ignite-404

command

dotnet ef dbcontext scaffold -f --use-database-names --schema xxx -o ./DbFirst "Host=x.x.x.x;Port=5432;Database=postgres;Username=gaussdb;Password=****;" DotNetCore.EntityFrameworkCore.GaussDB

dotnet ef dbcontext scaffold -f --use-database-names --schema xxx -o ./DbFirst "Host=x.x.x.x;Port=5432;Database=postgres;Username=gaussdb;Password=****;" DotNetCore.EntityFrameworkCore.GaussDB
Build started...
Build succeeded.
To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
System.Resources.MissingManifestResourceException: Could not find the resource "GaussDB.EntityFrameworkCore.PostgreSQL.Properties.GaussDBStrings.resources" among the resources "DotNetCore.EntityFrameworkCore.GaussDB.Properties.GaussDBStrings.resources", "DotNetCore.EntityFrameworkCore.GaussDB.Strings.resources" embedded in the assembly "DotNetCore.EntityFrameworkCore.GaussDB", nor among the resources in any satellite assemblies for the specified culture. Perhaps the resources were embedded with an incorrect name.
   at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
   at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists)       
   at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
   at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
   at GaussDB.EntityFrameworkCore.PostgreSQL.Internal.GaussDBResources.<>c.<LogFoundColumn>b__4_0(IDiagnosticsLogger logger)
   at Microsoft.EntityFrameworkCore.Internal.NonCapturingLazyInitializer.EnsureInitialized[TParam,TValue](TValue& target, TParam param, Func`2 valueFactory)
   at GaussDB.EntityFrameworkCore.PostgreSQL.Internal.GaussDBResources.LogFoundColumn(IDiagnosticsLogger logger)
   at GaussDB.EntityFrameworkCore.PostgreSQL.Internal.GaussDBLoggerExtensions.ColumnFound(IDiagnosticsLogger`1 diagnostics, String tableName, String columnName, String dataTypeName, Boolean nullable, Boolean identity, String defaultValue, String computedValue)
   at GaussDB.EntityFrameworkCore.PostgreSQL.Scaffolding.Internal.GaussDBDatabaseModelFactory.GetColumns(GaussDBConnection connection, IReadOnlyList`1 tables, String tableFilter, String internalSchemas, HashSet`1 enums, IDiagnosticsLogger`1 logger)
   at GaussDB.EntityFrameworkCore.PostgreSQL.Scaffolding.Internal.GaussDBDatabaseModelFactory.GetTables(GaussDBConnection connection, DatabaseModel databaseModel, Func`3 tableFilter, String internalSchemas, HashSet`1 enums, IDiagnosticsLogger`1 logger)
   at GaussDB.EntityFrameworkCore.PostgreSQL.Scaffolding.Internal.GaussDBDatabaseModelFactory.Create(DbConnection dbConnection, DatabaseModelFactoryOptions options)
   at GaussDB.EntityFrameworkCore.PostgreSQL.Scaffolding.Internal.GaussDBDatabaseModelFactory.Create(String connectionString, DatabaseModelFactoryOptions options)
   at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineerScaffolder.ScaffoldModel(String connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions)
   at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContext(String provider, String connectionString, String outputDir, String outputContextDir, String d
bContextClassName, IEnumerable`1 schemas, IEnumerable`1 tables, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean suppressOnConfiguring, Boolean noPluralize)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String outputDbContextDir, String dbCon
textClassName, IEnumerable`1 schemaFilters, IEnumerable`1 tableFilters, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean suppressOnConfiguring, Boolean noPluralize)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContext.<>c__DisplayClass0_0.<.ctor>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Could not find the resource "GaussDB.EntityFrameworkCore.PostgreSQL.Properties.GaussDBStrings.resources" among the resources "DotNetCore.EntityFrameworkCore.GaussDB.Properties.Gaus
sDBStrings.resources", "DotNetCore.EntityFrameworkCore.GaussDB.Strings.resources" embedded in the assembly "DotNetCore.EntityFrameworkCore.GaussDB", nor among the resources in any satellite assemblies for the specified culture. Perhaps the resources were embedded with an incorrect name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions