I have a `Logger` class which is implemented singleton. The class is simple and there are few methods and one `static` property, `Instance`. Like all singleton classes, I access the unique instance via `Logger.Instance` property.

I extracted an interface from `Logger` class (using Visual Studio refactor context menu). After extraction, interface contains signature for those few methods, and since the `Instance` property is `static`, it is not included in `ILogger` interface.

After all of this, I cannot cast a `Logger.Instance` into `ILogger` at run-time. What is wrong with my approach ?
['https://Stackoverflow.com/questions/4132955', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/313421/']
Did you actually declare that `Logger` implements `ILogger`?

```
public sealed class Logger : ILogger
{
    ...
}

```

If so, it should be fine. Please post some code so we can try to diagnose the issue.

If not, that's the problem, and it's easily fixed :)
The example you described works fine for me. I made a small example, maybe you see some differences:

```
class Program
{
    static void Main(string[] args)
    {
        ILogger logger = Logger.GetLogger();
        logger.LogMessage("Hello");
    }
}

public interface ILogger
{
    void LogMessage(string message);
}

public class Logger : ILogger
{
    private static Logger instance;

    public static Logger GetLogger()
    {
        return instance ?? (instance = new Logger());
    }

    public void LogMessage(string message)
    {
        Console.WriteLine(message);
    }
}

```