无法建立连接,因为目标计算机主动拒绝它127.0.0.1:61137 [英] No connection could be made because the target machine actively refused it 127.0.0.1:61137

查看:120
本文介绍了无法建立连接,因为目标计算机主动拒绝它127.0.0.1:61137的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试在Windows 2008 R2(X64)中使用NUnit控制台执行NUnit测试用例(.Net 4.0 .dll,针对NUnit 2.5.9编译),但失败并显示以下错误消息.有什么主意吗?


----

Hi,

I am trying to execute a NUnit test case (.Net 4.0 .dll, compiled against NUnit 2.5.9 ) using NUnit console in Windows 2008 R2 (X64) but it fails with below error message. Any idea?


----

System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:61137

Server stack trace:
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(EndPoint ipEndPoint)
   at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
   at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
   at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at NUnit.Core.TestRunner.get_Running()
   at NUnit.Core.ProxyTestRunner.get_Running()
   at NUnit.Util.TestLoader.get_Running()
   at NUnit.Gui.NUnitForm.get_IsTestRunning()
   at NUnit.Gui.NUnitForm.NUnitForm_Closing(Object sender, CancelEventArgs e)
   at System.Windows.Forms.Form.OnClosing(CancelEventArgs e)
   at System.Windows.Forms.Form.WmClose(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

推荐答案

Erhm,您确定防火墙已关闭,还是已在防火墙中创建了一条规则,允许通过给定的端口61137进行通信?
Erhm, are you sure your firewall is switched off, or that you''ve created a rule in your firewall allowing communication over the given port 61137?


爱德华,

感谢您的回复.

端口号一直在变化.现在是61137,上次是别的东西了.
我正在使用NUnit在单个框中手动执行DLL.即使DLL没有调用任何外部服务,我也应该检查防火墙吗?


谢谢,
Venu
Hi Eduard,

Thanks for your response.

Port number is changing all the time. Now it''s 61137 and last time it was some thing else.
I am executing the DLL manually using NUnit in a single box..should I be checking the firewall even if the DLL is not calling any external services?


Thanks,
Venu


我不知道这是否可行,但是当我在一个测试中实际上遇到无限循环时,我也从NUnit收到了同样的错误.

我有一些重载的as​​sert方法,最终循环回到了自己.当我使用TestDriven.Net工具运行代码时,我看到导致Nunit挂起的堆栈溢出异常,并最终返回您提到的错误.
I don''t know if this is possible, but I got this same error from NUnit when I actually had an infinite loop going in one of my tests.

I had some overloaded assert method that ended up looping back on itself. When I ran the code using the TestDriven.Net tool I saw the stack overflow exception that was causing Nunit to hang, and eventually return the error you mentioned.


这篇关于无法建立连接,因为目标计算机主动拒绝它127.0.0.1:61137的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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