简体   繁体   English

Visual Studio c#远程调试关闭Windows服务

[英]Visual studio c# remote debugging closes windows service

Im debugging my windows service occasionally from my computer when in fact the windows service is in a different far server. 我偶尔从我的电脑调试我的Windows服务,实际上Windows服务是在不同的远程服务器。 Im using the visual studio remote debugger to do so and then attaching my source to the service by connecting to the server via the 我使用visual studio远程调试器这样做,然后通过连接到服务器将我的源附加到服务

tools -> attach to process -> qualifier = server ip tools - > attach to process - > qualifier = server ip

The issue is that whenever I lose connection with the server due to internet error or etc, the windows server stops and shuts down in my server and I have to start it again. 问题是,每当我因为互联网错误等而失去与服务器的连接时,Windows服务器就会在我的服务器中停止并关闭,我必须再次启动它。

Perhaps I haven't provided enough information, so please ask for it instead of down vote. 也许我没有提供足够的信息,所以请求它而不是投票。

TIA. TIA。

Check Event Viewer on the remote server. 检查远程服务器上的事件查看器。 There should be an entry in the Application log if the service crashed. 如果服务崩溃,应用程序日志中应该有一个条目。 If you need more details, you can have Windows Error Reporter capture a crash dump when the service crashes. 如果您需要更多详细信息,可以让Windows Error Reporter在服务崩溃时捕获崩溃转储。 Details are here: http://msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx 详细信息如下: http//msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v = vs。85).aspx

GitHub recommends this as debugging procedure for their Windows client. GitHub建议将其作为Windows客户端的调试过程。 You can grab the .reg file from here and tweak it to match your path/executable. 您可以从此处获取.reg文件并进行调整以匹配您的路径/可执行文件。 https://help.github.com/articles/getting-a-crash-dump/ https://help.github.com/articles/getting-a-crash-dump/

Then you can bring the .dmp file to your machine and inspect it in Visual Studio / Windbg/SOS http://msdn.microsoft.com/en-us/library/d5zhxt22.aspx http://msdn.microsoft.com/en-us/library/windows/hardware/ff540665(v=vs.85).aspx 然后,您可以将.dmp文件带到您的计算机并在Visual Studio / Windbg / SOS中进行检查http://msdn.microsoft.com/en-us/library/d5zhxt22.aspx http://msdn.microsoft.com/ EN-US /库/窗/硬件/ ff540665(v = vs.85)的.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM