[architecture]
Tests each direct ProjectReference by removing it in memory and checking whether new compiler errors appear in the referencing project. Use it for compile-backed project cleanup planning.
Try this tool in Playground.
| Name | Type | Required | Description |
|---|---|---|---|
| projectName | string | No | Optional project name to limit analysis to one referencing project. |
| maxEvidenceDiagnostics | number | No | Maximum compiler diagnostics to include as evidence for a used reference. Default is 5. Use 0 to omit samples. |
Analyze all direct project references
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_unused_project_references",
"arguments": {}
}
}{
"success": true,
"data": {
"projectCountAnalyzed": 1,
"totalReferencesAnalyzed": 3,
"unusedReferenceCount": 1,
"items": [
{
"projectName": "MyProject.Web",
"referenceProjectName": "MyProject.Legacy",
"referencePath": "../MyProject.Legacy/MyProject.Legacy.csproj",
"canRemove": true,
"evidenceDiagnostics": []
}
]
},
"error": null
}Analyze one project with no evidence samples
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "find_unused_project_references",
"arguments": {
"projectName": "MyProject.Web",
"maxEvidenceDiagnostics": 0
}
}
}{
"success": true,
"data": {
"projectCountAnalyzed": 1,
"totalReferencesAnalyzed": 3,
"unusedReferenceCount": 1,
"items": [
{
"projectName": "MyProject.Web",
"referenceProjectName": "MyProject.Legacy",
"referencePath": "../MyProject.Legacy/MyProject.Legacy.csproj",
"canRemove": true,
"evidenceDiagnostics": []
}
]
},
"error": null
}Returns direct project references that appear removable, plus evidence when a reference is still required