Follow-up on #8
Description
When using alcops-mcp with the AL Language VS Code extension installed, the analyze tool returns AD0001 because the bundled LinterCop analyzer throws at runtime:
System.MissingMethodException: Method not found:
'System.String Microsoft.Dynamics.Nav.CodeAnalysis.Utilities.StringExtensions.QuoteIdentifierIfNeeded(System.String)'
at ALCops.LinterCop.Analyzers.InternalProcedureNotReferenced.MethodSymbolAnalyzer.ReportUnchangedReferencePassedParameters(...)
at ALCops.LinterCop.Analyzers.InternalProcedureNotReferenced.CheckApplicationObjects(...)
This appears to be a BC Development Tools version mismatch: the MCP server resolves DevTools from the AL Language extension (step 2 in BC Development Tools Resolution), but the bundled ALCops.Analyzers were compiled against an older DevTools build.
Other LinterCop rules that depend on the same analyzer (for example unused internal procedures) are silently skipped when this crash occurs.
Steps to reproduce
-
Install AL Language VS Code extension (recent v17 build).
-
Install the MCP server: dotnet tool install -g ALCops.Mcp (tested with 0.1.0-alpha.7).
-
Configure Cursor / Claude with:
{
"mcpServers": {
"alcops": {
"command": "alcops-mcp"
}
}
}
-
Open a small AL project with code analysis enabled and at least one unused internal procedure (optional, to show missing LinterCop diagnostics).
-
Call the MCP analyze tool with minSeverity: "Warning".
Actual behavior
-
AD0001 warning: LinterCop analyzer InternalProcedureNotReferenced throws MissingMethodException.
-
Only non-LinterCop warnings are returned reliably (for example CodeCop AA0228).
-
On MCP startup (stderr), DevTools resolve to the AL extension:
BC DevTools: C:\Users\<user>\.vscode\extensions\ms-dynamics-smb.al-17.0.2273547\bin\Analyzers
Example diagnostic payload:
{
"id": "AD0001",
"message": "Analyzer 'ALCops.LinterCop.Analyzers.InternalProcedureNotReferenced' threw an exception of type 'System.MissingMethodException' ... QuoteIdentifierIfNeeded ...",
"severity": "Warning",
"copName": "Unknown",
"hasCodeFix": false
}
Expected behavior
- LinterCop analyzers run without crashing.
- DevTools version used at runtime matches the version ALCops.Analyzers was built against, or the MCP server selects a compatible pair automatically.
- Rules such as unused internal procedures are reported when applicable.
Environment
| Component |
Version |
| OS |
Windows 10 (10.0.26200) |
| MCP client |
Cursor |
alcops-mcp (ALCops.Mcp) |
0.1.0-alpha.7 |
Bundled ALCops.LinterCop.dll |
0.5.0 |
Bundled target (from ALCops.Mcp.deps.json) |
Microsoft.Dynamics.Nav.CodeAnalysis 17.0.33.55542 |
| AL Language VS Code extension |
ms-dynamics-smb.al 17.0.2273547 |
Resolved Microsoft.Dynamics.Nav.CodeAnalysis.dll (from extension bin\Analyzers) |
17.0.34.45391 |
BCDEVELOPMENTTOOLSPATH |
(not set) |
~/.alcops/cache/devtools/ |
(empty before manual download) |
NuGet DevTools versions confirmed on nuget.org:
17.0.33.55542 — matches bundled ALCops.Analyzers dependency
17.0.34.45391 — matches current AL Language extension
Root cause analysis
Per MCP Server — BC Development Tools Resolution, when BCDEVELOPMENTTOOLSPATH is unset and the AL Language extension is installed, the server always prefers the extension’s DevTools over the local cache or NuGet auto-download.
In this setup:
- ALCops.Analyzers 0.5.0 (shipped inside
alcops-mcp) targets DevTools 17.0.33.55542.
- The AL Language extension supplies DevTools 17.0.34.45391.
- A breaking API change between those patch releases (
StringExtensions.QuoteIdentifierIfNeeded) causes LinterCop to fail at runtime.
This matches the general “version mismatch between detection and compilation” guidance in the ALCops troubleshooting docs, applied to the MCP server’s DevTools resolution order.
Follow-up on #8
Description
When using
alcops-mcpwith the AL Language VS Code extension installed, theanalyzetool returns AD0001 because the bundled LinterCop analyzer throws at runtime:This appears to be a BC Development Tools version mismatch: the MCP server resolves DevTools from the AL Language extension (step 2 in BC Development Tools Resolution), but the bundled ALCops.Analyzers were compiled against an older DevTools build.
Other LinterCop rules that depend on the same analyzer (for example unused internal procedures) are silently skipped when this crash occurs.
Steps to reproduce
Install AL Language VS Code extension (recent v17 build).
Install the MCP server:
dotnet tool install -g ALCops.Mcp(tested with0.1.0-alpha.7).Configure Cursor / Claude with:
{ "mcpServers": { "alcops": { "command": "alcops-mcp" } } }Open a small AL project with code analysis enabled and at least one unused internal procedure (optional, to show missing LinterCop diagnostics).
Call the MCP
analyzetool withminSeverity: "Warning".Actual behavior
AD0001 warning: LinterCop analyzer
InternalProcedureNotReferencedthrowsMissingMethodException.Only non-LinterCop warnings are returned reliably (for example CodeCop AA0228).
On MCP startup (stderr), DevTools resolve to the AL extension:
Example diagnostic payload:
{ "id": "AD0001", "message": "Analyzer 'ALCops.LinterCop.Analyzers.InternalProcedureNotReferenced' threw an exception of type 'System.MissingMethodException' ... QuoteIdentifierIfNeeded ...", "severity": "Warning", "copName": "Unknown", "hasCodeFix": false }Expected behavior
Environment
alcops-mcp(ALCops.Mcp)0.1.0-alpha.7ALCops.LinterCop.dll0.5.0ALCops.Mcp.deps.json)Microsoft.Dynamics.Nav.CodeAnalysis17.0.33.55542ms-dynamics-smb.al17.0.2273547Microsoft.Dynamics.Nav.CodeAnalysis.dll(from extensionbin\Analyzers)BCDEVELOPMENTTOOLSPATH~/.alcops/cache/devtools/NuGet DevTools versions confirmed on nuget.org:
17.0.33.55542— matches bundled ALCops.Analyzers dependency17.0.34.45391— matches current AL Language extensionRoot cause analysis
Per MCP Server — BC Development Tools Resolution, when
BCDEVELOPMENTTOOLSPATHis unset and the AL Language extension is installed, the server always prefers the extension’s DevTools over the local cache or NuGet auto-download.In this setup:
alcops-mcp) targets DevTools 17.0.33.55542.StringExtensions.QuoteIdentifierIfNeeded) causes LinterCop to fail at runtime.This matches the general “version mismatch between detection and compilation” guidance in the ALCops troubleshooting docs, applied to the MCP server’s DevTools resolution order.