Migrated the legacy VB.NET Windows Service to a modern C# Worker Service targeting .NET Framework 4.6.2. Key changes include: - Added `Microsoft.Extensions.Hosting.WindowsServices`, `NLog`, and `Quartz` for logging and scheduling. - Introduced `LogConfigFactory` to bridge `ServiceConfig` and `LogConfig` for Quartz jobs. - Rewrote `Worker` to handle the full service lifecycle, including database connection, temp file management, and scheduler initialization. - Implemented `SchedulerFinishEnvelope` and `SchedulerEnvelopeTaskApi` for Quartz job scheduling. - Created `TempFiles` for service-level temp file management. - Configured `NLog` for file and console logging. - Updated `appsettings.json` for connection strings and service-specific configuration. - Replaced legacy `ProjectInstaller` with `AddWindowsService()` for SCM integration.
21 lines
718 B
XML
21 lines
718 B
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
autoReload="true">
|
|
|
|
<targets async="true">
|
|
<target xsi:type="File"
|
|
name="file"
|
|
fileName="${basedir}/Log/service-${shortdate}.log"
|
|
layout="${longdate} | ${level:uppercase=true} | ${logger} | ${message}${onexception:${newline}${exception:format=tostring}}" />
|
|
<target xsi:type="Console"
|
|
name="console"
|
|
layout="${longdate} | ${level:uppercase=true} | ${logger} | ${message}" />
|
|
</targets>
|
|
|
|
<rules>
|
|
<logger name="*" minlevel="Debug" writeTo="file,console" />
|
|
</rules>
|
|
|
|
</nlog>
|