<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AssemblyName>Sbroenne.ExcelMcp.ComInterop</AssemblyName>
<RootNamespace>Sbroenne.ExcelMcp.ComInterop</RootNamespace>
<!-- Suppress CA1848 - LoggerMessage delegates not needed for low-frequency diagnostics -->
<NoWarn>$(NoWarn);CA1848</NoWarn>
<Version>1.0.0</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<PackageId>Sbroenne.ExcelMcp.ComInterop</PackageId>
<Title>Sbroenne ExcelMcp COM Interop Library</Title>
<Description>COM interop utilities for Excel automation by Sbroenne. Provides low-level COM object lifecycle management, STA threading, OLE message filtering, and Excel session management. Foundation library for robust Excel COM automation.</Description>
<PackageTags>excel;automation;com;interop;ole;sta;threading;excel-automation;windows;sbroenne</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>See https://github.com/sbroenne/mcp-server-excel/releases for release notes</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<!-- Package Validation -->
<EnablePackageValidation>true</EnablePackageValidation>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleTo Include="Sbroenne.ExcelMcp.ComInterop.Tests" />
<InternalsVisibleTo Include="Sbroenne.ExcelMcp.Core.Tests" />
</ItemGroup>
<!-- Release Build Optimizations -->
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<!-- Disable debug symbols in Release builds -->
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
<!-- Additional optimization flags -->
<Optimize>true</Optimize>
<TieredCompilation>true</TieredCompilation>
<TieredCompilationQuickJit>true</TieredCompilationQuickJit>
</PropertyGroup>
<!-- Remove XML docs and PDB files from Release output -->
<Target Name="RemoveDebugFilesFromRelease" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'">
<ItemGroup>
<XmlDocsToDelete Include="$(OutputPath)**\*.xml" />
<PdbFilesToDelete Include="$(OutputPath)**\*.pdb" />
</ItemGroup>
<Delete Files="@(XmlDocsToDelete)" />
<Delete Files="@(PdbFilesToDelete)" />
</Target>
<ItemGroup>
<!-- Include README and LICENSE in package -->
<None Include="README.md" Pack="true" PackagePath="\" />
<None Include="..\..\LICENSE" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<!-- Excel COM Interop PIA - EmbedInteropTypes=true embeds only used types at compile time,
eliminating the runtime dependency on office.dll (Microsoft.Office.Core) which is not
available to .NET Core's runtime loader even though it exists in the .NET Framework GAC.
COM type equivalence (GUID-based) ensures type identity works across assembly boundaries. -->
<PackageReference Include="Microsoft.Office.Interop.Excel">
<EmbedInteropTypes>true</EmbedInteropTypes>
<NoWarn>NU1701</NoWarn>
</PackageReference>
<!-- office.dll (Microsoft.Office.Core): NOT referenced here.
EmbedInteropTypes=true on Microsoft.Office.Interop.Excel embeds all statically-used
Office Core types at compile time, so no runtime copy is needed.
The only dynamic access (AutomationSecurity) uses ((dynamic)(object)) cast to force
IDispatch binding, preventing any runtime load of office.dll.
Copying office.dll (GAC path is version-specific and machine-specific) previously caused
version mismatch crashes: hint path 15.0.0.0 vs runtime expectation 16.0.0.0. -->
<PackageReference Include="Dax.Formatter" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Resilience" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>