Skip to content

'MySqlConnector.Core.ConnectionPool' threw an exception #1569

@Kantabriko

Description

@Kantabriko

Software versions
NuGet Package 2.40
VB.NET Framework 4.6.2
MariaDB 10.11
It is happening in a W2022 server, in other systems (with different SO) it is working properly.

Describe the bug
When opening a DB connection it throws the next exception:
The type initializer for 'MySqlConnector.Core.ConnectionPool' threw an exception. - - Error Description InnerExc.: The type initializer for 'PerTypeValues`1' threw an exception.

Code sample
Public Sub New(ByVal strConnectionString As String)
Try

       Try
           ConnectionString = strConnectionString
           objConn = New MySqlConnection(strConnectionString)
           objConn.Open()

           If objConn.State = ConnectionState.Closed Then
               objConn.Open()
           End If
       Catch ex As MySqlException
           MsgError = "DB Error: " & ex.Message & " - A connection to DB cannot be established." & vbCr & "ConnectString = " & strConnectionString
           Exit Sub
       End Try
   Catch ex2 As Exception
       MsgError = "Error: " & ex2.Message & " - A connection to DB cannot be established." & vbCr & "ConnectString = " & strConnectionString
       Exit Sub
   End Try

The exception is thrown through Catch ex2 As Exception

Additional context
DBConnectString = server=;port=3306;userid=root;password=<PWD;database=

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