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