<Project>

  <!-- TeslaLauncherService.csproj and TeslaLauncherAgent.csproj share this one
       directory, so by default they also share obj\project.assets.json. NuGet
       restore writes that single file per project, so whichever restores last
       wins and the other compiles against the wrong package set (e.g. the
       Service losing Microsoft.Extensions.Hosting). Give each project its own
       intermediate directory so their restore outputs no longer collide.
       (bin\ is safe to share — the two assemblies have distinct names.) -->
  <PropertyGroup>
    <BaseIntermediateOutputPath>obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
  </PropertyGroup>

  <!-- With per-project obj subdirs, each project would otherwise glob the OTHER
       project's generated sources (AssemblyInfo.cs, etc.) out of the sibling
       obj\ subtree, causing duplicate-attribute errors. The SDK only excludes a
       project's own BaseIntermediateOutputPath by default, so exclude the whole
       obj\ and bin\ trees here. The SDK appends its own defaults to this. -->
  <PropertyGroup>
    <DefaultItemExcludes>$(DefaultItemExcludes);$(MSBuildProjectDirectory)\obj\**;$(MSBuildProjectDirectory)\bin\**</DefaultItemExcludes>
  </PropertyGroup>

</Project>
