Bug #103430 Shared memory connection crashes on open
Submitted: 22 Apr 2021 13:01 Modified: 16 Sep 2021 7:01
Reporter: Dan Han Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:8.0.24 OS:Windows (10 Pro 64-bits and Server 2012 tested)
Assigned to: CPU Architecture:x86 (64-bit)
Tags: shared memory

[22 Apr 2021 13:01] Dan Han
Description:
When trying to connect using shared memory I get the following exception:
System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=MySql.Data
  StackTrace:
   at MySql.Data.MySqlClient.NativeDriver.Open()
   at MySql.Data.MySqlClient.Driver.Open()
   at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
   at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
   at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
   at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
   at MySql.Data.MySqlClient.MySqlPool.GetConnection()
   at MySql.Data.MySqlClient.MySqlConnection.Open()

I had a few older projects that I tried and all versions of those worked:
8.0.23
8.0.22
8.0.20
8.0.16
6.9.12
6.9.9

How to repeat:
Use a connection string with the additional settings:
"Protocol=Memory;Shared Memory Name=MYSQL"

Try to open it.
[22 Apr 2021 14:49] Bradley Grainger
It seems likely to be caused by this commit: https://github.com/mysql/mysql-connector-net/commit/5ab13c21#diff-6659c05978bc1779f3d9a920...

If so, named pipe connections (on Windows) will also throw an exception.
[16 Sep 2021 7:01] MySQL Verification Team
Hello Dan Han,

Thank you for the bug report.
This issue has been fixed in C/NET 8.0.26, please try with latest release.
We didn't see any issues at our end in C/NET 8.0.26.

Regards,
Ashwini Patil