Skip to content

Set IsPackable=true on Microsoft.AspNetCore.Components.Gateway so Pack produces the shipping nupkg#66579

Merged
danroth27 merged 1 commit intodotnet:mainfrom
danroth27:fix-gateway-pack-isPackable
May 5, 2026
Merged

Set IsPackable=true on Microsoft.AspNetCore.Components.Gateway so Pack produces the shipping nupkg#66579
danroth27 merged 1 commit intodotnet:mainfrom
danroth27:fix-gateway-pack-isPackable

Conversation

@danroth27
Copy link
Copy Markdown
Member

@danroth27 danroth27 commented May 5, 2026

Summary

Microsoft.AspNetCore.Components.Gateway is configured as a shipping package (<IsShippingPackage>true</IsShippingPackage>) with a custom <NuspecFile>, but no nupkg has been produced on the dnceng feeds since the project was added in #65982. Root cause: Microsoft.NET.Sdk.Web.ProjectSystem.props defaults IsPackable to false:

<IsPackable Condition="'$(IsPackable)' == ''">false</IsPackable>

Because Gateway uses Sdk="Microsoft.NET.Sdk.Web" and never overrides IsPackable, the Pack target silently no-ops ΓÇö the <NuspecFile> and <IsShippingPackage> settings are ignored. (The Microsoft.AspNetCore.Components.WebAssembly.DevServer project, which is the closest analog and ships correctly, uses plain Microsoft.NET.Sdk and so doesn't hit this default.)

Fix

Set <IsPackable>true</IsPackable> explicitly in Microsoft.AspNetCore.Components.Gateway.csproj. One-line change.

Verification

Before:

> .\eng\build.ps1 -pack -projects src\Components\Gateway\src\Microsoft.AspNetCore.Components.Gateway.csproj
Build succeeded.
    0 Warning(s)
    0 Error(s)
> Get-ChildItem artifacts\packages -Recurse -Filter '*.nupkg'
# (no output ΓÇö no package produced)

After:

> .\eng\build.ps1 -pack -projects src\Components\Gateway\src\Microsoft.AspNetCore.Components.Gateway.csproj
  Successfully created package 'artifacts\packages\Debug\Shipping\Microsoft.AspNetCore.Components.Gateway.11.0.0-dev.nupkg'.
  Successfully created package 'artifacts\packages\Debug\Shipping\Microsoft.AspNetCore.Components.Gateway.11.0.0-dev.symbols.nupkg'.
Build succeeded.

Inspecting the produced nupkg confirms the expected payload:

Path Notes
Microsoft.AspNetCore.Components.Gateway.nuspec from existing <NuspecFile>
build/Microsoft.AspNetCore.Components.Gateway.targets consumer-side props/targets
tools/blazor-gateway.{dll,exe} the host
tools/Yarp.ReverseProxy.dll, tools/Microsoft.Extensions.ServiceDiscovery*.dll, tools/System.IO.Hashing.dll dependencies
tools/blazor-gateway.runtimeconfig.json, tools/web.config, tools/blazor-gateway.deps.json runtime config
THIRD-PARTY-NOTICES.txt, Icon.png metadata

Why this matters for 11.0 P4

Without this fix, dotnet add package Microsoft.AspNetCore.Components.Gateway --prerelease returns no result on any feed, so the Gateway can only be exercised by building it locally and copying the host bits into a sample.

cc @javiercn

Microsoft.NET.Sdk.Web.ProjectSystem.props sets <IsPackable>false</IsPackable>
by default. The Gateway project uses the Web SDK with a custom <NuspecFile>
and <IsShippingPackage>true</IsShippingPackage>, but Pack silently no-ops
under the Web SDK default, so no shipping nupkg is produced.

Set <IsPackable>true</IsPackable> explicitly so the existing nuspec is honored
and Microsoft.AspNetCore.Components.Gateway.<version>.nupkg is produced into
artifacts/packages/<config>/Shipping/ alongside the other shipping packages.

Verified locally: before this change, ./eng/build.ps1 -pack -projects ... succeeds
with 0 errors but produces no nupkg anywhere under artifacts/. After this change,
the same invocation produces both the package and its symbols package in the
Shipping folder, with the expected build/ targets and tools/ payload.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 5, 2026 04:18
@danroth27 danroth27 requested a review from a team as a code owner May 5, 2026 04:18
danroth27 pushed a commit to dotnet/core that referenced this pull request May 5, 2026
The Microsoft.AspNetCore.Components.Gateway package isn't being produced on
the build feeds (the Web SDK defaults IsPackable to false, silently no-op'ing
Pack). A fix is up at dotnet/aspnetcore#66579 but won't make Preview 4, so
remove the section and TOC entry; we'll bring it back when the package ships.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label May 5, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes packaging for Microsoft.AspNetCore.Components.Gateway so the repo’s pack step actually emits the intended shipping NuGet package. It aligns the Gateway project with the existing custom-nuspec packaging setup already used for similar Components tooling.

Changes:

  • Explicitly sets IsPackable=true on Microsoft.AspNetCore.Components.Gateway.
  • Documents why the override is required when using Microsoft.NET.Sdk.Web.
  • Ensures the existing custom .nuspec-based pack flow can produce the shipping .nupkg.

@danroth27 danroth27 requested a review from javiercn May 5, 2026 14:56
@danroth27 danroth27 merged commit 05434a9 into dotnet:main May 5, 2026
31 checks passed
@dotnet-policy-service dotnet-policy-service Bot added this to the 11.0-preview5 milestone May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants