Port service registration to C#

The problems still persist:
- The extension doesn't load in VS2012
- It is fragile in VS2013