1

vb and c# programs using mysql are running on W7 or W8.1 from network share. But when I try to run on W10 after windows update, I get this error:

   Exception Info: System.Net.Sockets.SocketException
   at System.Net.Sockets.Socket..ctor(System.Net.Sockets.AddressFamily, System.Net.Sockets.SocketType, System.Net.Sockets.ProtocolType)
   at MySql.Data.Common.MyNetworkStream.CreateSocketStream(MySql.Data.MySqlClient.MySqlConnectionStringBuilder, System.Net.IPAddress, Boolean)
   at MySql.Data.Common.MyNetworkStream.CreateStream(MySql.Data.MySqlClient.MySqlConnectionStringBuilder, Boolean)
   at MySql.Data.Common.StreamCreator.GetStream(MySql.Data.MySqlClient.MySqlConnectionStringBuilder)
   at MySql.Data.MySqlClient.NativeDriver.Open()

Exception Info: MySql.Data.MySqlClient.MySqlException
   at MySql.Data.MySqlClient.NativeDriver.Open()
   at MySql.Data.MySqlClient.Driver.Open()
   at MySql.Data.MySqlClient.Driver.Create(MySql.Data.MySqlClient.MySqlConnectionStringBuilder)
   at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
   at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
   at MySql.Data.MySqlClient.MySqlPool.GetConnection()
   at MySql.Data.MySqlClient.MySqlConnection.Open()

Event viewer shows two application error. First error:

Application: XX.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Net.Sockets.SocketException
   at System.Net.Sockets.Socket..ctor(System.Net.Sockets.AddressFamily, System.Net.Sockets.SocketType, System.Net.Sockets.ProtocolType)
   at MySql.Data.Common.MyNetworkStream.CreateSocketStream(MySql.Data.MySqlClient.MySqlConnectionStringBuilder, System.Net.IPAddress, Boolean)
   at MySql.Data.Common.MyNetworkStream.CreateStream(MySql.Data.MySqlClient.MySqlConnectionStringBuilder, Boolean)
   at MySql.Data.Common.StreamCreator.GetStream(MySql.Data.MySqlClient.MySqlConnectionStringBuilder)
   at MySql.Data.MySqlClient.NativeDriver.Open()

Exception Info: MySql.Data.MySqlClient.MySqlException
   at MySql.Data.MySqlClient.NativeDriver.Open()
   at MySql.Data.MySqlClient.Driver.Open()
   at MySql.Data.MySqlClient.Driver.Create(MySql.Data.MySqlClient.MySqlConnectionStringBuilder)
   at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
   at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
   at MySql.Data.MySqlClient.MySqlPool.GetConnection()
   at MySql.Data.MySqlClient.MySqlConnection.Open()
   at FC.DBCon.DoConnect(System.String, Boolean)
   at FC.DBCon.Connect(Int32, Boolean, System.String)
   at FC.DBCon.Connect(System.String)
   at FC.Login.Initialize(System.String, FC.DBCon, MySqlData.myData)
   at XX.Program.Main()

Second error:

Faulting application: XX.exe, version : 1.0.0.0, time stamp: 0x5acef816
Faulting module: KERNELBASE.dll, version : 10.0.17134.1, time stamp: 0x149ab0fd
Exception code: 0xe0434352
Fault offset 0x0010d722
Fault proses id: 0x1668
Fault application start time: 0x01d3ec19c067bf50
Faulting application path: \\192.168.1.5\programs\global\XX.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: 764d5d02-01a4-43dd-a02c-8162f8a3af23
Faulting package full name: 
Faulting package-relative application ID: 

Any other .net programs can run without any errors from the same network share. Can anyone please help?

Panagiotis Kanavos
  • 120,703
  • 13
  • 188
  • 236
muludag
  • 134
  • 1
  • 8
  • 1
    Have you confirmed that the network share is the issue by trying to run it locally? – ProgrammingLlama May 15 '18 at 10:48
  • 1
    This isn't the first time someone posts a similar question. Post the *full* exception and call stack. You can get it through `Exception.ToString()`. This is probably *not* related to Windows 10 but the bundled .NET 4.7.2 – Panagiotis Kanavos May 15 '18 at 10:50
  • Yes, programs can run locally without any problems. – muludag May 15 '18 at 10:57
  • @M.U post the full exception. This isn't the first time a weird bug was introduced in 4.7.2. Now that the source is up on [referencesource](https://referencesource.microsoft.com/#System/net/System/Net/Sockets/Socket.cs) one could check which constructor was called and what could raise that exception – Panagiotis Kanavos May 15 '18 at 11:06
  • @PanagiotisKanavos I added two event viewer errors to the question. – muludag May 15 '18 at 11:09
  • @M.U unfortunately the event viewer description also doesn't include the exception message. You could wrap a try/catch block around the call to `FC.Login.Initialize()` and log the `exception.ToString()` from code. – C.Evenhuis May 15 '18 at 11:12
  • It would probably also be helpful if you posted the error messages in _English_, not _Turkish_. – Jeff Zeitlin May 15 '18 at 11:28
  • 3
    It is a SMBv1 share? from [After Windows 10 update 1803 my program can't open a socket when running from network share](https://stackoverflow.com/questions/50155482/after-windows-10-update-1803-my-program-cant-open-a-socket-when-running-from-ne) - _"Windows 10 update 1803 does not open network connections on executables files on SMBv1 share (as Windows Server 2003)"_ - of which this question may be a duplicate. – stuartd May 15 '18 at 13:07
  • It is Windows Server 2003, so SMBv1 share. The answer is the same with the answer of that question. Windows 10 update 1803 does not open network connections on executables files on SMBv1 share (as Windows Server 2003) – muludag May 15 '18 at 13:34
  • @M.U SMBv1 was discontinued looong ago and its removal was announced [well in advance](https://blogs.technet.microsoft.com/josebda/2015/04/21/the-deprecation-of-smb1-you-should-be-planning-to-get-rid-of-this-old-smb-dialect/), especially after last year's ransomware attacks. Windows 2003 went end-of-life in 2015. That's not just an old version, that's a version without any kind of support any more, not even security patches – Panagiotis Kanavos May 15 '18 at 14:51
  • @M.U does the program work if you store it on a newer machine? Perhaps all you need to do is store it on a different file server – Panagiotis Kanavos May 15 '18 at 14:58
  • 1
    It no longer allows this [for good reasons](https://blogs.technet.microsoft.com/filecab/2016/09/16/stop-using-smb1/) – stuartd May 15 '18 at 15:40
  • @PanagiotisKanavos yes,the program works well on a newer machine. – muludag May 16 '18 at 06:25

0 Answers0