Fix service dependency on the Windows framework

This commit is contained in:
Jordan Dominion
2023-07-17 13:18:22 -04:00
parent a605dd9e21
commit 361d300896
3 changed files with 7 additions and 1 deletions
@@ -3,6 +3,7 @@ using System.Collections.Specialized;
using System.Configuration.Install;
using System.IO;
using System.Reflection;
using System.Runtime.Versioning;
using System.ServiceProcess;
using System.Threading;
using System.Threading.Tasks;
@@ -20,6 +21,7 @@ namespace Tgstation.Server.Host.Service
/// <summary>
/// Contains the entrypoint for the application.
/// </summary>
[SupportedOSPlatform("windows")]
sealed class Program
{
/// <summary>
@@ -4,6 +4,7 @@ using System.Diagnostics;
using System.IO;
using System.IO.Pipes;
using System.Linq;
using System.Runtime.Versioning;
using System.ServiceProcess;
using System.Text;
using System.Threading;
@@ -21,6 +22,7 @@ namespace Tgstation.Server.Host.Service
/// <summary>
/// Represents a <see cref="IWatchdog"/> as a <see cref="ServiceBase"/>.
/// </summary>
[SupportedOSPlatform("windows")]
sealed class ServerService : ServiceBase, ISignalChecker
{
/// <summary>
@@ -3,7 +3,9 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>$(TgsFrameworkVersion)-windows</TargetFramework>
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
<!-- DO NOT ADD THE -windows SUFFIX, It makes the service require the desktop runtime instead of the ASP NET Core Hosting Bundle -->
<TargetFramework>$(TgsFrameworkVersion)</TargetFramework>
<Version>$(TgsCoreVersion)</Version>
<!-- DO NOT ENABLE THIS, It makes the service require the desktop runtime instead of the ASP NET Core Hosting Bundle -->
<UseWindowsForms>false</UseWindowsForms>