swa-troubleshooting

Diagnose and fix Static Web Assets test and build failures in the .NET SDK.

1.2k|337|Updated Oct 13, 2022
One-click install
npx skills add https://github.com/dotnet/dotnet --skill swa-troubleshooting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swa-troubleshooting
Source: https://github.com/dotnet/dotnet/tree/main/src/sdk/.claude/skills/swa-troubleshooting
Command: npx skills add https://github.com/dotnet/dotnet --skill swa-troubleshooting

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Static Web Assets (SWA) tests and builds in the .NET SDK fail in recurring, recognizable ways, and developers waste time re-deriving root causes from raw CI error messages. This Skill maps common error signatures to their root causes and provides concrete diagnostic and fix procedures.

Core Features & Use Cases

  • Failure Pattern Catalog: Six documented failure patterns covering metadata propagation bugs, MSBuild target ordering gaps, baseline drift, pack content mismatches, WASM/PWA manifest failures, and stale test assertions.
  • Diagnostic Guidance: Step-by-step approaches using binlogs (-bl), DependsOnTargets analysis, and metadata tracing to locate root causes in src/StaticWebAssetsSdk/.
  • CI Triage Strategy: A method for grouping AzDO/Helix test failures by test class, error signature, and TFM to distinguish code problems from infrastructure noise.
  • Use Case: A CI run shows "Expected nupkg to contain 'build\X' but it was not found". The Skill directs you to Microsoft.NET.Sdk.StaticWebAssets.Pack.targets, identifies the TFM-conditional branch, and tells you to update test assertions to match that branch.

Quick Start

Analyze this failing Static Web Assets test output and tell me the root cause category and how to fix it.

Frequently Asked Questions about swa-troubleshooting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I diagnose Static Web Assets test failures in the .NET SDK?

Match the error message against known failure signatures such as metadata mismatches, missing assets, or baseline drift. Then trace the producing MSBuild task or target, using a binlog generated with -bl to inspect item metadata and target execution order.

How to fix MSBuild target ordering issues with DependsOnTargets?

Identify the target that produces the missing data and the target that consumes it using the binlog. Add an explicit DependsOnTargets declaration on the consuming target so producer targets complete first, especially when BeforeTargets triggers targets too early.

Why do Static Web Assets baseline tests fail after a build change?

Baseline failures occur when legitimate build output changes but the expected baseline JSON files were not regenerated. The error typically states the generated manifest should match the expected baseline, and the fix is regenerating baselines with the swa-baseline-regeneration skill.

Why does the nupkg pack test fail with missing build files?

Pack targets use MSBuild conditions based on TFM and feature flags to decide nupkg content. If the test asserts files from a different branch than its configuration activates, update the assertions in Microsoft.NET.Sdk.StaticWebAssets.Pack.targets' matching condition.

How do I triage multiple CI failures in Azure DevOps Helix tests?

Group failures by test class and error signature to find shared root causes, then check whether failing tests target the current or an older TFM. Separate baseline failures from assertion failures, and exclude infrastructure issues like timeouts or Helix agent errors.