Answer the question
In order to leave comments, you need to log in
How to debug a crashing service
There is a wcf service that uses 32-bit third-party Dlls.
It works great on IIS express because it's natively 32 bit. There is iiS8, it is originally 64 bit. It has an enable32 bit application checkbox , but with this checkbox the service crashes. It crashes so that nothing is displayed in the browser. Question. Where to poke next?
Answer the question
In order to leave comments, you need to log in
Personal experience of writing services:
Globally catch exceptions, and when caught, either write to the Event Log or write to a file.
I answer myself after how many years there
For debugging, we use the config.
stackoverflow.com/questions/4271517/how-to-turn-on...
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="CardSpace">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.IO.Log">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.Runtime.Serialization">
<listeners>
<add name="xml" />
</listeners>
</source>
<source name="System.IdentityModel">
<listeners>
<add name="xml" />
</listeners>
</source>
</sources>
<sharedListeners>
<add name="xml"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="C:\PerfLogs\Traces.svclog" />
</sharedListeners>
</system.diagnostics>
Alternatively, you can view the event log: Computer Management - Utilities - Event Viewer - Windows Logs.
There may be something written by the system or the service itself before the fall.
And the service itself is assembled, by chance, not under "Any CPU"? Try to build under 32 bit.
1. Try to make a self-host service. On it, such a problem cannot be by definition.
2. If you need to connect a debugger to the service, but you don’t have time to do it because the service has crashed, then find a point in the service that definitely succeeds (most likely it will be some kind of constructor), and add the Debugger code there. Attach()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question