This commit is contained in:
parent
ac83188bc8
commit
4b105c81b8
|
|
@ -13,11 +13,20 @@ internal class ServiceMain : ServiceControl
|
|||
{
|
||||
ILog appLog = LogManager.GetLogger(Program.AppName);
|
||||
ConcurrentBag<Task> tasks = new();
|
||||
Version? AssemblyVersion = null;
|
||||
|
||||
public bool Start(HostControl hostControl)
|
||||
{
|
||||
try
|
||||
{
|
||||
AssemblyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
}
|
||||
catch
|
||||
{
|
||||
AssemblyVersion = new Version("1.0");
|
||||
}
|
||||
tasks.Add(Task.Run(() => { Looper(); }));
|
||||
appLog.Info(string.Format("Service successfully started."));
|
||||
appLog.Info(string.Format("Service successfully started - v{0}", AssemblyVersion.ToString()));
|
||||
return true;
|
||||
} //Start
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net9.0-windows</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AssemblyVersion>1.3.0.5</AssemblyVersion>
|
||||
<FileVersion>1.3.0.5</FileVersion>
|
||||
<Version>1.3.0.5</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -20,4 +23,8 @@
|
|||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="if /I "$(ConfigurationName)" == "Release" c:\Misc\AutoVersionIncrement.exe "$(ProjectDir)"" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Reference in New Issue