Skip to content

Commit 084c9c7

Browse files
sbroenneStefan Broenner
andauthored
fix(cli): add workaround for PackAsTool + net10.0-windows (#396)
Add MSBuild targets that temporarily clear TargetPlatformIdentifier during pack validation, allowing PackAsTool to work with UseWindowsForms. Workaround from: dotnet/sdk#12055 (comment) This allows the CLI to remain a dotnet tool while keeping the system tray feature. Co-authored-by: Stefan Broenner <[email protected]>
1 parent 6f80344 commit 084c9c7

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/ExcelMcp.CLI/ExcelMcp.CLI.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,19 @@
100100
<InternalsVisibleTo Include="Sbroenne.ExcelMcp.CLI.Tests" />
101101
</ItemGroup>
102102

103+
<!-- Workaround for NETSDK1146: PackAsTool doesn't support net10.0-windows -->
104+
<!-- See: https://github.com/dotnet/sdk/issues/12055#issuecomment-2125927648 -->
105+
<Target Name="HackBeforePackToolValidation" BeforeTargets="_PackToolValidation">
106+
<PropertyGroup>
107+
<TargetPlatformIdentifier></TargetPlatformIdentifier>
108+
<TargetPlatformMoniker></TargetPlatformMoniker>
109+
</PropertyGroup>
110+
</Target>
111+
112+
<Target Name="HackAfterPackToolValidation" AfterTargets="_PackToolValidation" BeforeTargets="PackTool">
113+
<PropertyGroup>
114+
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
115+
</PropertyGroup>
116+
</Target>
117+
103118
</Project>

0 commit comments

Comments
 (0)