I am running some self written Winforms .net 3.5 applications from a shared folder in Windows 10.
Everything worked correctly, but after the last big update (1803) the application doesn't start any more.
It seems that the program is crashing in the moment it is trying to open a socket. The first problem was when accessing the database it got the following exception:
2018-05-03 14:36:32,314 [1] ERROR NHibernate.Transaction.AdoTransaction [(null)] - Begin transaction failed
MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts. ---> System.Net.Sockets.SocketException: invalid argument
at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
at MySql.Data.Common.MyNetworkStream.CreateSocketStream(MySqlConnectionStringBuilder settings, IPAddress ip, Boolean unix)
at MySql.Data.Common.MyNetworkStream.CreateStream(MySqlConnectionStringBuilder settings, Boolean unix)
at MySql.Data.Common.StreamCreator.GetStream(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.NativeDriver.Open()
I've tried to work around this issue, but even accessing a SSH server didn't work when the program is started from the network share:
2018-05-03 14:30:30,654 [1] ERROR WinForms.SpringApplication [(null)] - Main Handler
Tamir.SharpSsh.jsch.JSchException: System.Net.Sockets.SocketException: invalid argument
at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
at Tamir.SharpSsh.java.net.Socket..ctor(String host, Int32 port)
at Tamir.SharpSsh.jsch.Util.createSocket(String host, Int32 port, Int32 timeout)
bei Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout)
bei Tamir.SharpSsh.SshBase.ConnectSession(Int32 tcpPort)
bei Tamir.SharpSsh.SshBase.Connect(Int32 tcpPort)
bei Tamir.SharpSsh.SshBase.Connect()
When I copy the directory locally the program works fine.
Any ideas why it seems that Windows is blocking access to sockets when I'm starting this program from a network share ?
I know about trusting .net code, so it can be run from a network share, but I've renewed the full trust and it still crashes (and normally it crashes much earlier if I didn't do a full trust).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…