[solution]
Restores packages with dotnet restore (or a workspace-local NuGet.exe with runner 'nuget' for packages.config solutions), separating NU warnings from failures, and stores a GliderTrace restore session with a structured restored/up-to-date/failed summary.
Restore failures and NU warnings decide whether a build can even start, and they are easy to lose in console output.
The model gets a restored/up-to-date/failed summary with NU warnings separated from failures before attempting a build.
Try it locally in the GliderTrace playground
| Name | Type | Required | Description |
|---|---|---|---|
| targetPath | string | No | Optional solution, project, directory, or (with runner 'nuget') packages.config path under the workspace root. Defaults to the workspace root. |
| runner | string | No | Restore runner: 'auto' (default, dotnet restore) or 'nuget' (a workspace-local .nuget\NuGet.exe; requires the server started with --allow-executable nuget-workspace). |
| nugetConfigPath | string | No | Optional NuGet configuration file under the workspace root, mapped to --configfile / -ConfigFile. |
| packagesDirectory | string | No | Optional packages directory under the workspace root, mapped to --packages / -PackagesDirectory. |
| lockedMode | boolean | No | Fail when the lock file is out of date (--locked-mode / -LockedMode). Defaults to false. |
| disableParallelProcessing | boolean | No | Disable parallel restore (--disable-parallel / -DisableParallelProcessing). Defaults to false. |
| environment | json | No | Optional environment variables to set for the restore process. |
| timeoutMs | number | No | Optional restore timeout in milliseconds. When exceeded the session completes with status timeout. |
| summaryLimit | number | No | Maximum diagnostics returned in topFindings, errors first. Clamped to 1..100. Defaults to 20. |
Restore the workspace with dotnet restore
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "trace_restore",
"arguments": {}
}
}Restore a packages.config solution with the workspace NuGet.exe
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "trace_restore",
"arguments": {
"runner": "nuget",
"targetPath": "MyApp.sln"
}
}
}Returns a restore session id, status, exit code, restoredProjects/upToDateProjects/failedProjects/nuWarningCount/nuErrorCount/restoreSucceeded summary, errors-first topFindings, and (dotnet runner) a sensitive restore.binlog artifact reference.