Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile any AL extensions #7954

Open
1 of 6 tasks
JohnNozzi opened this issue Jan 20, 2025 · 5 comments
Open
1 of 6 tasks

Cannot compile any AL extensions #7954

JohnNozzi opened this issue Jan 20, 2025 · 5 comments
Labels

Comments

@JohnNozzi
Copy link

JohnNozzi commented Jan 20, 2025

Please include the following with each issue:

1. Describe the bug
I can compile no al extensions since the latest update.

2. To Reproduce
Bring up ANY al extension, press CTRL+SHIFT+B, and receive the error below:

[Error - 4:22:04 PM] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible.
Processing of message 'al/createPackage' failed with error: 'One or more errors occurred. (An item with the same key has already been added. Key: Microsoft.Dynamics.Nav.PerTenantExtensionCop.RuleAvoidDuplicateObjectNames)'
Details:
System.AggregateException: One or more errors occurred. (An item with the same key has already been added. Key: Microsoft.Dynamics.Nav.PerTenantExtensionCop.RuleAvoidDuplicateObjectNames)
---> System.ArgumentException: An item with the same key has already been added. Key: Microsoft.Dynamics.Nav.PerTenantExtensionCop.RuleAvoidDuplicateObjectNames
at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.Generic.Dictionary2.Add(TKey key, TValue value)
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerDriverBase.LogTelemetry(ITelemetryService telemetryService, AnalysisScope scope) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerDriver.cs:line 557
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerDriverBase.<>c__DisplayClass49_0.<b__1>d.MoveNext() in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerDriver.cs:line 529
--- End of stack trace from previous location ---
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerDriverBase.GetDiagnosticsAsync(Compilation compilation) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerDriver.cs:line 280
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result()
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.PackageTheModule(Compilation compilation, CompilerTextWriter consoleOutput, CancellationToken cancellationToken, ErrorLogger errorLogger, AnalyzerDriver analyzerDriver, Predicate1 filterOpt, Predicate1 radCompilationFilter) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:line 814
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.RunCoreImpl(CompilerTextWriter consoleOutput, ErrorLogger errorLogger, Compilation compilation, AnalyzerDriver analyzerDriver, IEnumerable1 analyzerExceptionDiagnostics, IEnumerable1 additionalTextFiles, CancellationToken cancellationToken) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:line 565
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.RunCore(CompilerTextWriter consoleOutput, ErrorLogger errorLogger, ITelemetryService telemetryService, CancellationToken cancellationToken) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:line 495
at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.Run(CompilerTextWriter consoleOutput, ITelemetryService telemetryService, CancellationToken cancellationToken) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:line 345
at Microsoft.Dynamics.Nav.EditorServices.Protocol.Utility.ActiveProjectBuilder.Build(VsCodeWorkspace workspace, Project builtProject, StreamingTextWriter outputWriter, Boolean isRad, IList1 args, CancellationToken cancellationToken, IResponseQueue responseQueue, ITelemetryService telemetryService, Boolean forceBuild, IList1 outputFiles, CustomTelemetryEvent telemetryEvent, String requestVsCodeExtensionVersion) in X:\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Utility\ActiveProjectBuilder.cs:line 204
at Microsoft.Dynamics.Nav.EditorServices.Protocol.Utility.ActiveProjectBuilder.BuildWorkspaceAsync(CancellationToken cancellationToken, IFileSystem fileSystem, VsCodeWorkspace workspace, String projectDir, IList1 args, Boolean buildDependencyPackage, Boolean isRad, IResponseQueue responseQueue, Boolean forceBuildOfAllDependencies, CustomTelemetryEvent telemetryEvent, ITelemetryService telemetryService, String vsCodeExtensionVersion) in X:\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Utility\ActiveProjectBuilder.cs:line 115 at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.Extensions.CreatePackageRequestHandler.HandleAsync(CreatePackageRequest request, Int32 requestId, CancellationToken cancellationToken) in X:\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\Extensions\CreatePackageRequestHandler.cs:line 37 at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase1.HandleAsync(JToken requestContents, Int32 requestId, CancellationToken cancellationToken) in X:\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:line 85
at Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry.Process(Message message) in X:\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:line 84

3. Expected behavior
I expected an al file to be created. No changes occurred in any of my code since last week, when they compiled successfully.

4. Actual behavior
The above error appeared in the Output panel. Note that it included the instruction to report the issue here.

5. Versions:

  • AL Language: v15.0.1290655 (pre-release)
  • Visual Studio Code: 1.96.4 (user setup)
  • Business Central: v25
  • List of Visual Studio Code extensions that you have installed:
  • Operating System:
    • Windows
    • Linux
    • MacOS

Final Checklist

Please remember to do the following:

  • Search the issue repository to ensure you are reporting a new issue

  • Reproduce the issue after disabling all extensions except the AL Language extension

  • Simplify your code around the issue to better isolate the problem

Internal work item: AB#563144

@BazookaMusic
Copy link
Contributor

Remove ptecop temporarily from analyzers and it should work. I'm accepting this so we can fix it asap

@skkulla
Copy link

skkulla commented Jan 21, 2025

Removing analyzers is no help, same error

@yannstlo
Copy link

Installed VSIX 25.2 manually and it allowed me to build.
Still waiting on a fix.
Thanks

@GrzegorzSzwed
Copy link

Removing analyzers on pre-release version (v15.0.1290655) from extension level .vscode/settings.json helped!
When I switched back to release version it solved the problem.

@navdotnetreqs
Copy link

navdotnetreqs commented Feb 4, 2025

Got same error today! Setting "al.enableCodeAnalysis": false and removing "al.codeAnalyzers" entirely allowed to bypass this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants