开发者

Windows Service Setup Project - Include Debug Symbols

I have a WCF service which is being hosted as Windows Service. In WCF service code library - error handling code, I have added something like below to show the error details(message+stack开发者_JAVA百科 trace) in eventvwr:

    catch (Exception ex)
    {
        var logger = new EventLogExceptionLogger();
        logger.HandleException(ex); //Show exception Stack Trace in Event Viewer
    }

To allow stack trace to show up in event viewer, I went to service setup project and Added Project Output to include Debug Symbols for WCF service library.

Now when I run the setup, service is being installed successfully with WCFServiceLibrary.pdb file being included in the installation folder...but when any error occurs, no stack trace is being shown in the event viewer.

Any ideas?

Thank you!


You don't need PDB symbols to get stack trace. PDB symbols for managed binaries are only needed if you want to get local variables or source line numbers.

Few possible reasons you might not see events being logged:

  • Your service account does not have permission to write to event log. For example if you are writing to system event log and use regular user account, you will not see any events.
  • The exeption is not thrown. Check that your code is actually called using debugger. The failure might have been handled by lower level WCF code.
  • There might be a bug in your EventLogExceptionLogger implementation
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜