changed debug writelines to console writelines for desktop operation. tidied code. moved over to use PostAsync, to prevent app hanging when trying to post to DataCenter. changed api endpoint to windows datacenter desktop endpoint. --end Service1 changes. remove args from Start method --end Program changes added try catch to stop errors when the data center endpoint isnt up. --end DataCenterHelper changes. removed topshelf configuration stuff. --end ConfigureService changes.
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CardReaderService
|
|
{
|
|
internal static class ConfigureService
|
|
{
|
|
internal static void Configure()
|
|
{
|
|
//try
|
|
//{
|
|
// HostFactory.Run(configure =>
|
|
// {
|
|
// configure.Service<Service1>(service =>
|
|
// {
|
|
// service.ConstructUsing(s => new Service1());
|
|
// service.WhenStarted(s => s.Start());
|
|
// service.WhenStopped(s => s.Stop());
|
|
// });
|
|
// //Setup Account that window service use to run.
|
|
// configure.RunAsLocalSystem();
|
|
// configure.SetServiceName("MyWindowServiceWithTopshelf");
|
|
// configure.SetDisplayName("MyWindowServiceWithTopshelf");
|
|
// configure.SetDescription("My .Net windows service with Topshelf");
|
|
// });
|
|
//}
|
|
//catch (Exception ex)
|
|
//{
|
|
|
|
// throw;
|
|
//}
|
|
}
|
|
}
|
|
}
|