Windows Service Project to fetch data and write to a CSV file on specific time interval
##Technology and Version
- .NET 6 using C#
- Visual Studio 2022
- Windows 10 Operating System
##Reference Documents:
- Windows Service in .NET 6 : https://docs.microsoft.com/en-us/dotnet/core/extensions/windows-service
- Windows Service Commands (sc.exe) : https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/sc-create
##Instructions to Setup, Build and Deploy this Application
- Download of Checkout of the project from master branch
- Make sure to change the value of "OutputCSVPath" property in appsettings, before running the application. Also in Test project
- Open the code in Visual Studio 2022, and add the "PowerService.dll" from https://github.com/kkmoorthy/PetroineosCodingChallenge in both projects.
- This DLL reference idly, should be via NuGet package
- Run the Test cases or the application, to veryify the code and functionality
- Run Publish in the Visual Studio. If profile is missing, make sure to create Profile as per the instructions in the Micrisoft Documentation (Reference links)
- After successful publish, open CMD as Administrator and run below command to install Windows Service
- sc.exe create "SuneelTestWS" start=auto binpath="D:\Working\dotnet\SuneelTestWS\SuneelTestWS\bin\Release\net6.0\publish\win-x64\SuneelTestWS.exe"
- To delete the service use below command
- sc.exe delete "SuneelTestWS"
- Open the Services window, to see the installation status of our Windows Service. Start if not started
- Verify the output path, if the files are being generated