NPGSQL - Common Language Runtime detected an invalid program.
DSpada
0
Reputation points
I have two servers with windows server 2019 and an a Simple API project developed with .NET 8. The project use Npgsql library at version 4.0.0.
The configuration between servers are the same:
- same path
- same .NET hosting bundle
- same IIS configuration
- same build
The API opens connection, get postgreSQL Database version and closes the connection.
But on the first server the API works correctly on the second one it return this error:
Values Problem to open the connection
System.InvalidProgramException: Common Language Runtime detected an invalid program.
at Npgsql.NpgsqlDataReader.Read(Boolean async)
at Npgsql.NpgsqlDataReader.Read()
at Npgsql.PostgresDatabaseInfo.LoadBackendTypes(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async)
at Npgsql.PostgresDatabaseInfo.LoadPostgresInfo(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async)
at Npgsql.PostgresDatabaseInfoFactory.Load(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async)
at Npgsql.NpgsqlDatabaseInfo.Load(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async)
at Npgsql.NpgsqlConnector.LoadDatabaseInfo(NpgsqlTimeout timeout, Boolean async)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.ConnectorPool.AllocateLong(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnection.<>c__DisplayClass32_0.<<Open>g__OpenLong|0>d.MoveNext()
--- End of stack trace from previous location ---
at Npgsql.NpgsqlConnection.Open()
at MyAPI.Values.Values(String httpRequestDomainName) in C:\MyAPI\Controllers\Values.cs:line 45
I check permission, web.config, IIS configuration, folder permission, CLR configuration and between server are the same
I tried everything, reset IIS, clear cache, reboot servers but without success.
can you give me support?
Sign in to answer