<Project Sdk="Microsoft.NET.Sdk.Worker">

  <PropertyGroup>
    <TargetFramework>net8.0-windows</TargetFramework>
    <Nullable>disable</Nullable>
    <ImplicitUsings>disable</ImplicitUsings>
    <WarningsAsErrors></WarningsAsErrors>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <Version>4.11.4.1</Version>
    <ApplicationIcon>app.ico</ApplicationIcon>
    <AssemblyName>TeslaLauncherService</AssemblyName>
    <RootNamespace>Tesla.Launcher.Service</RootNamespace>
    <Platforms>x64</Platforms>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <SelfContained>true</SelfContained>
    <PublishSingleFile>true</PublishSingleFile>
    <WindowsService>true</WindowsService>
  </PropertyGroup>

  <ItemGroup>
    <!-- Exclude the Agent source — it belongs to TeslaLauncherAgent.csproj only -->
    <Compile Remove="TeslaLauncherAgent.cs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Hosting"                  Version="8.*" />
    <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices"  Version="8.*" />
    <PackageReference Include="Microsoft.Extensions.Logging.EventLog"         Version="8.*" />
    <!-- Required by SecureConfig.cs for COM2/PlasmaIO serial output -->
    <PackageReference Include="System.IO.Ports"                               Version="8.0.0" />
  </ItemGroup>

  <ItemGroup>
    <!-- Tesla.Net wire types now come from the shared contract (net6 build),
         replacing the hand-maintained replica in LaunchModels_Shared.cs.
         SetPlatform pins the reference to AnyCPU: this project is x86, the
         contract is platform-neutral, and without the pin MSBuild's dynamic
         platform negotiation corrupts this project's restore (one-shot
         `dotnet build` of the solution then fails to resolve its packages). -->
    <ProjectReference Include="..\Contract\Tesla.Contract.csproj" SetPlatform="Platform=AnyCPU" />
  </ItemGroup>


</Project>
