Windows 10更新1803之后,从网络共享运行时我的程序无法打开套接字 [英] After Windows 10 update 1803 my program can't open a socket when running from network share

查看:109
本文介绍了Windows 10更新1803之后,从网络共享运行时我的程序无法打开套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从Windows 10的共享文件夹中运行一些自行编写的Winforms .net 3.5应用程序.

I am running some self written Winforms .net 3.5 applications from a shared folder in Windows 10.

一切正常,但是在上次重大更新(1803)之后,该应用程序无法再启动.

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()

我已经尝试解决此问题,但是当从网络共享启动程序时,甚至无法访问SSH服务器:

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.

有什么主意,为什么我从网络共享启动此程序时Windows似乎阻止了对套接字的访问?

Any ideas why it seems that Windows is blocking access to sockets when I'm starting this program from a network share ?

我了解信任.net代码,因此可以从网络共享中运行它,但是我已经重新获得了完全信任,但是仍然崩溃(并且如果我不完全信任,它通常会崩溃得更早)

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).

推荐答案

我们有关于此问题的一些信息:

We have some information about this issue:

Windows 10更新1803无法在以下位置打开网络连接 SMBv1共享(作为Windows Server 2003)上的可执行文件

Windows 10 update 1803 does not open network connections on executables files on SMBv1 share (as Windows Server 2003)

您可以尝试将程序移至SMBv2或SMBv3兼容服务器以进行检查.

You can try to move your program to a SMBv2 or SMBv3 compatible server to check it.

这篇关于Windows 10更新1803之后,从网络共享运行时我的程序无法打开套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆