Description:
I have a VB.NET application (Windows Forms Project)running on :
* Windows 7 64-bit
* Visual Studio 2012
* .Net Framework 4.5
* MySQL Server 5.6.10
* MySqlConnect Net 6.6.5
I noticed the following:
1. If MySqlConnection is declared as :
Dim con as MySqlConnection
No problemo at all when debugging my code.
However,
2. If MySqlConnection is declared as :
Dim myConString As String = "server=localhost;uid=root;pwd=123;database=mysql;"
Dim con As New MySqlConnection(myConString)
an first-time exception is thrown (details below) which is reported in the 'Immediate Window' of the VS2012.
However, if I disable 'Managed Debugging Assistant' Exceptions setting in VS2012, still the exception is thrown but the application run successfully and VS2012
continue to report the exception errors every time I have
Dim As New MySqlConnection statement in my app !
When I enabled 'Managed Debugging Assistant' in Exceptions setting, the app breaks when faced with 'Dim As New MySqlConnection'
Below are some info VS2012 debug reported :
*******************************************
Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in 'C:\Users\Khaled\Documents\Visual Studio 2012\Projects\TradingAnalysis\TradingAnalysis\bin\x64\Debug\TradingAnalysis.exe'.
Additional Information: The runtime has encountered a fatal error. The address of the error was at 0xe85e39de, on thread 0x1598. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
If there is a handler for this exception, the program may be safely continued.
*******************************************
When I press continue this error appears:
*******************************************
An unhandled exception of type 'System.ExecutionEngineException' occurred in System.Data.dll
*******************************************
System.Data.dll!Bid.Bid() + 0x49 bytes
[Native to Managed Transition]
System.Data.dll!System.Data.Common.DbConnectionStringBuilder.Clear() + 0x25 bytes MySql.Data.dll!MySql.Data.MySqlClient.MySqlConnectionStringBuilder.Clear() + 0x62 bytes
MySql.Data.dll!MySql.Data.MySqlClient.MySqlConnectionStringBuilder.MySqlConnectionStringBuilder() + 0x96 bytes
MySql.Data.dll!MySql.Data.MySqlClient.MySqlConnection.MySqlConnection() + 0x57 bytes
******************************************
Could you please advise for a solution.
Thanks,
Khaled
How to repeat:
it repeats whenever my application have Dim As New MySqlConnection