dotnetcore / dotnetcore/EntityFrameworkCore.GaussDB

ef core db first 生成 entity 失败

Offen
#8 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C#
Sterne
45
Forks
6
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

# 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.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.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.
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Den gemeldeten Befehl dotnet ef dbcontext scaffold reproduzieren und den angeforderten Namen GaussDB.EntityFrameworkCore.PostgreSQL.Properties.GaussDBStrings.resources mit den in DotNetCore.EntityFrameworkCore.GaussDB eingebetteten Ressourcen vergleichen. Die im Stacktrace gezeigte GaussDBResources-Suche nachverfolgen; als erledigt gilt die Aufgabe, wenn das Scaffolding ohne MissingManifestResourceException abgeschlossen wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
backend, databases
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.