public Task Start()
{
return(Task.Factory.StartNew(() => {
try
{
_runner = new RemoteServiceRunner(x => {
x.Setup.ApplicationName = Path.GetDirectoryName(_serviceDirectory).Replace(" ", "-");
x.ServiceDirectory = _serviceDirectory;
if (_link.ConfigFile.IsNotEmpty())
{
x.Setup.ConfigurationFile = _link.ConfigFile;
}
if (_link.BootstrapperName.IsNotEmpty())
{
x.BootstrapperName = _link.BootstrapperName;
}
x.Setup.ShadowCopyFiles = true.ToString();
});
Console.WriteLine("Successfully started the remote service at " + _serviceDirectory);
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
_watcher.WatchBinariesAt(_serviceDirectory);
}));
}