<?xml version="1.0" encoding="utf-8"?>
<Project>
  <!-- Emit the [DisableRuntimeMarshalling] attribute for all .NET 8 projects -->
  <ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
    <AssemblyAttribute Include="System.Runtime.CompilerServices.DisableRuntimeMarshallingAttribute" />
  </ItemGroup>

  <!-- Emit the [ComVisible(false)] attribute for WinUI targets -->
  <ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0-windows'))">
    <AssemblyAttribute Include="System.Runtime.InteropServices.ComVisibleAttribute">
      <_Parameter1>false</_Parameter1>
    </AssemblyAttribute>
  </ItemGroup>
  
  <!-- Settings that are only set for libraries -->
  <PropertyGroup Condition=" '$(OutputType)' == 'Library' ">
    <IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>
  </PropertyGroup>

</Project>
