PM> Scaffold-DbContext "server=localhost;database=SimulationDatabase;uid=postgres;pwd=123456;port=5432;" Npgsql.EntityFrameworkCore.PostgreSQL -OutputDir PgModel -Force 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 http://go.microsoft.com/fwlink/?LinkId=723263. Npgsql.PostgresException (0x80004005): 3D000: ���ݿ� "SimulationDatabase" ������ at Npgsql.Internal.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|215_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|195_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt) at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) at Npgsql.ConnectorPool.OpenNewConnector(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) at Npgsql.ConnectorPool.<Get>g__RentAsync|28_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|45_0(Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlConnection.Open() at Npgsql.EntityFrameworkCore.PostgreSQL.Scaffolding.Internal.NpgsqlDatabaseModelFactory.Create(DbConnection dbConnection, DatabaseModelFactoryOptions options) at Npgsql.EntityFrameworkCore.PostgreSQL.Scaffolding.Internal.NpgsqlDatabaseModelFactory.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 dbContextClassName, 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 dbContextClassName, IEnumerable`1 schemaFilters, IEnumerable`1 tableFilters, String modelNamespace, String contextNamespace, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames, Boolean suppressOnConfiguring, Boolean noPluarlize) 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) Exception data: Severity: �������� SqlState: 3D000 MessageText: ���ݿ� "SimulationDatabase" ������ File: d:\pginstaller_12.auto\postgres.windows-x64\src\backend\utils\init\postinit.c Line: 879 Routine: InitPostgres 3D000: ���ݿ� "SimulationDatabase" ������
Solution:
PM> Scaffold-DbContext "Host=localhost; Port=5432 ;Database=simulation;Username=postgres;Password=123456" Npgsql.EntityFrameworkCore.PostgreSQL -OutputDir PostgreSqlModels -Context DBContext -force 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 http://go.microsoft.com/fwlink/?LinkId=723263.
Read More:
- [Solved] QT error: the packaged exe of Enigma virtual box reports an error cannot load library qt5core.dll
- [Solved] C++ reason ncnn model error: Segmentation fault (core dumped)
- The problem of using GB2312 encoding in .NET Core to report errors
- .Net Core 5.0 Upload File limit via Swagger Api report error: error: request entity too large [Three Methods]
- TensorRT model quantization error: Error Code 1: Cuda Runtime (an illegal memory access was encountered)
- Uniapp: TypeError: Cannot read property ‘apply‘ of undefined (H5 does not report an error, but the real machine runs with an error)
- [Solved] net core HTTP Error 500.31 – Failed to load ASP.NET Core runtime HTTP Error 500.30 – ASP.NET Core
- CARLA Report an Error: rpc server [How to Solve]
- Kafka Creates and Writes Logs Error [How to Solve]
- [Solved] Asp.Net Core IIS Error: HTTP Error 500.30 – ASP.NET Core app failed to start
- [Solved] dyld: Library not loaded: /System/Library/Frameworks/Network.framework/Network
- M1 MacBook pod install Report an error chip incompatibility problem
- Report Duplicate keys detected: ‘0’. This may cause an update error in VUE and the solution
- [Solved] Spring cloud config server can’t parse the YML file of the remote warehouse, and it will also report an error
- Centos7 hive started to report an error. There is no route to the host. The firewall has been closed
- [Solved] An unexpected error has occurred. Conda has prepared the above report.
- Onnx to tensorrt model error [How to Solve]
- Cv2.dnn read model error [How to Solve]
- [Solved] Instantiation of ‘sdram_model_plus‘ failed. The design unit was not found.