A
A
Alexander Borisovich2013-08-07 11:10:27
IIS
Alexander Borisovich, 2013-08-07 11:10:27

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

5 answer(s)
D
dima_horror, 2013-12-23
@dima_horror

Personal experience of writing services:
Globally catch exceptions, and when caught, either write to the Event Log or write to a file.

A
Alexander Borisovich, 2015-07-16
@Alexufo

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>

the problem went away when moving to IIS8.5 in winserver2012

G
Gregory, 2013-08-07
@difiso

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.

N
neru, 2013-08-08
@neru

And the service itself is assembled, by chance, not under "Any CPU"? Try to build under 32 bit.

M
mayorovp, 2013-08-08
@mayorovp

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 question

Ask a Question

731 491 924 answers to any question