[英]Microsoft Visual Studio C Runtime Library has detected a fatal error
我必须在“ C#”中创建一个wcf Windows服务...有时它会在我的Windows服务exe中显示此错误“ Microsoft Visual Studio C运行时库检测到致命错误” ...我不知道发生此错误的地方。没有堆栈痕迹。任何人都提前提出解决方案。
can you reproduce the error consistently? 您可以一致地重现错误吗? If so attach a debugger ( like this or this ) to the service and follow the steps to reproduce the error, setting break points in the places where the error happens.
如果是这样,则将调试器( 例如this 或this )连接到服务,并按照步骤重现错误,并在发生错误的位置设置断点。
If not try adding some logging to your service to try and trackdown where the problem is happening and give you some where to focus your investigations when it does crash. 如果没有尝试,请向您的服务中添加一些日志记录,以尝试跟踪问题发生的位置,并在崩溃时为您提供集中精力进行调查的位置。
I would suggest that you check through the Windows Event Viewer for further information on what this error may be. 我建议您通过Windows事件查看器检查有关此错误可能的进一步信息。
Then I would be tempted to place try...catch blocks within your code in likely places where you may be triggering this error. 然后,我很想将try ... catch块放置在代码中可能触发此错误的可能位置。 The Event viewer may give you more detial as to what was called to trigger the error.
事件查看器可以为您提供更多有关触发错误的详细信息。
As you have written a service I would suggest that you look at logging faults like this within the Event Viewer rather than in a log file (although there's no harm in doing this for a fast test). 在编写服务时,我建议您在事件查看器中而不是在日志文件中查看类似的日志记录错误(尽管这样做对于进行快速测试没有害处)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.