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

  <PropertyGroup>
    <TargetFramework>net472</TargetFramework>
    <PlatformTarget>x64</PlatformTarget>
    <RootNamespace>CncCollector</RootNamespace>
    <AssemblyName>CncCollector</AssemblyName>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <!-- Windows Service 控制台应用，可交互安装 -->
    <OutputType>Exe</OutputType>
    <OutputPath>bin\</OutputPath>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.3" PrivateAssets="all" />
    <!-- JSON序列化 -->
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
    <!-- ORM -->
    <PackageReference Include="Dapper" Version="2.1.35" />
    <!-- MariaDB驱动 -->
    <PackageReference Include="MySqlConnector" Version="2.3.7" />
    <!-- 日志 -->
    <PackageReference Include="log4net" Version="3.3.1" />
  </ItemGroup>

  <!-- Framework 引用 -->
  <ItemGroup>
    <Reference Include="System.Net.Http" />
    <Reference Include="System.IO" />
    <Reference Include="System.Runtime" />
    <Reference Include="System.ServiceProcess" />
    <Reference Include="System.Configuration.Install" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\CncModels\CncModels.csproj" />
    <ProjectReference Include="..\CncRepository\CncRepository.csproj" />
  </ItemGroup>

  <!-- 将配置文件复制到输出目录 -->
  <ItemGroup>
    <None Update="collector.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="log4net.config">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>

</Project>
