| name | download-maui-pr-nugets |
| description | Download and configure NuGet packages from an unmerged .NET MAUI PR to test fixes before they're released. Use this when a user wants to test packages from a specific dotnet/maui pull request. |
Download NuGet Packages from a .NET MAUI Pull Request
Purpose
Download and configure NuGet packages from an unmerged .NET MAUI PR to test fixes before they're released.
When to Use
- User wants to test a bug fix from a specific MAUI PR
- User needs packages from an unmerged PR in dotnet/maui
Steps
1. Get PR Information
Fetch the PR details to find the Azure DevOps build:
github-mcp-server-pull_request_read(method: "get", owner: "dotnet", repo: "maui", pullNumber: <PR_NUMBER>)
2. Find the Azure DevOps Build
The PR's head branch name is needed. Search for workflow runs or check the PR's checks page:
https://github.com/dotnet/maui/pull/<PR_NUMBER>/checks
The build URL follows this pattern:
https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=<BUILD_ID>
3. Get Build Artifacts Info
Fetch the build details to get the package version:
curl -s "https://dev.azure.com/dnceng-public/public/_apis/build/builds/<BUILD_ID>" | grep -o '"buildNumber":"[^"]*"'
The version format is typically: 10.0.XX-ci.prXXXXX.XXXXX.XX
4. Download Package Artifacts
mkdir -p local-packages
curl -sL "https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_apis/build/builds/<BUILD_ID>/artifacts?artifactName=PackageArtifacts&api-version=7.1&%24format=zip" \
-o local-packages/pr-packages.zip
unzip -q local-packages/pr-packages.zip -d local-packages/
5. Configure NuGet.config
Create or update NuGet.config in the project root:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="local-pr-packages" value="./local-packages/PackageArtifacts" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
6. Update Project References
Update the .csproj file to use the specific PR version:
<PackageReference Include="Microsoft.Maui.Controls" Version="10.0.XX-ci.prXXXXX.XXXXX.XX" />
Important: Only add packages the user actually needs. Don't add extra packages (like Maps) unless explicitly requested.
7. Verify Configuration
rm -rf obj bin
dotnet restore
Then validate the resolved version:
cat obj/project.assets.json | grep -o '"Microsoft.Maui.Controls/[^"]*"' | head -1
Example
For PR #33643 with build ID 1260895:
curl -sL "https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_apis/build/builds/1260895/artifacts?artifactName=PackageArtifacts&api-version=7.1&%24format=zip" \
-o local-packages/pr-packages.zip
unzip -q local-packages/pr-packages.zip -d local-packages/
ls local-packages/PackageArtifacts/*.nupkg
Version resolved: 10.0.40-ci.pr33643.26071.21
Notes
- PR packages are NOT published to public feeds - they must be downloaded from build artifacts
- The
dotnet10 nightly feed (https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10/nuget/v3/index.json) only has main branch builds, not PR builds
- Dependencies from nuget.org are sufficient; the dotnet10 feed is optional
- Always verify the resolved version in
project.assets.json after restore