Question: I have working web service. I had to use same code and develop REST web service. I have done it. When I was debugging it I found one unusual thing. Static constructors are not being called when I am debugging my `RESTWebService` project.

All business logic is inside one DLL. Both `WebService` and `RESTWebService` projects use this DLL. Following are those static constructor which are present inside DLL. These constructors initialize some static values. 

```
//Logger.cs
static Logger()
{
    try
    {
        m_LogLevel = ....;
        m_LogFilePath = ....;
    }
    catch
    {
        throw;
    }
}

//Common.cs
static Common()
{
    ERROR_CODES = ....;
    DB_CONNECTION_STRING = ....;
    DB_NOTIFICATION_CONNECTION_STRING = ....;
    DATA_PROVIDER_INVARIANT_NAME = ....;
}

```

All values initialized in constructor are declared as static.

In case of `WebService` project it is initializing all static variables through static constructor. I have verified it by keeping break point to this static constructor. It will hit all static constructor and in the end public constructor of my web service.

But this is not happening in case of `RESTWebService`. All environment is exactly like my `WebService`. But it does not hit static constructor's break point and directly hits `RestWebService`'s public constructor.

What would be the reason behind this? I am new to WCF. Is there any other thing with RESTWebService?

Answer: 
Don't check if it was called via a breakpoint - instead, when an instance/service mthod is called, check if the values are actually initialized. Or try to log something from the static constructor and see if it was called.

The static constructor may be called before you have a chance to debug/break on it.
The static constructors should still be called, but this will happen when the hosting program first loads your DLL.

It could be that the host (IIS I presume?) has the service loaded before you added your breakpoint. Try an IISRESET and then check again, you will need to attach to the iis worker process for debugging.