Multi level generics in C#

To create multi level generic inheritance in C3 following structure could be used:

// top most inheritance level
public class TopLayer: MidLayer<TopLayer>
{
	// Your code goes here
}

// internal layer
public class MidLayer<T>: BaseLayer<T> where T: MidLevelLayer<T>, new ()
{
	// Your code goes here
}

// base layer
public class BaseLayer<T> : IBaseObject, new()
{
	// Your code goes here
}

// (optional) Interface
public interface IBaseObject
{
	// Your code goes here
}

Simple self restartable windows service

To make a self restartable service simple cmd script may be used.
Code is in C#:

private void RestartSrv()
{
	_log.Debug($"RestartSrv()");
	try
	{
		var name = "SomeServiceName";

		var f = @"C:\restart.cmd"; // put this somewhere

		_log.Trace($"creating {f}");

		var cmd = new string[]
		{
			"@ECHO OFF",
			$"net stop {name}",
			"PING -n 20 127.0.0.1 > NUL",
			$"net start {name}",
		};

		File.WriteAllLines(f, cmd, Encoding.ASCII);

		_log.Trace($"launching {f}");
		var nfo = new ProcessStartInfo(f);
		Process.Start(nfo);
	}
	catch (Exception ex)
	{
		_log.Error(ex, "RestartSrv()");
	}
	
}