Processing of message 'textDocument/codeAction' failed with error
Describe the bug With the current AL extension supplied by the daily builds docker hub, these errors come up as soon as symbols are successfully downloaded.
Processing of message 'textDocument/codeAction' failed with error: 'Das angegebene Argument liegt außerhalb des gültigen Wertebereichs. Parametername: span' Details: System.ArgumentOutOfRangeException: Das angegebene Argument liegt außerhalb des gültigen Wertebereichs. Parametername: span bei Microsoft.Dynamics.Nav.CodeAnalysis.SyntaxNode.FindNode(TextSpan span, Boolean findInsideTrivia, Boolean getInnermostNodeForTie) in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Syntax\SyntaxNode.cs:Zeile 1240. bei Microsoft.Dynamics.Nav.CodeAnalysis.ConvertIfToCase.ConvertIfToCaseCodeRefactoringProvider.
d__0.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\CodeRefactoring\Providers\ConvertIfToCase\ConvertIfToCaseCodeRefactoringProvider.cs:Zeile 28. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.CodeAnalysis.CodeRefactoring.CodeRefactoringService. d__5.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\CodeRefactoring\CodeRefactoringService.cs:Zeile 87. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.CodeAnalysis.CodeRefactoring.CodeRefactoringService. d__4.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\CodeRefactoring\CodeRefactoringService.cs:Zeile 44. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.CodeActionRequestHandler. d__9.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\CodeActionRequestHandler.cs:Zeile 70. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase`1. d__9.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:Zeile 43. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry. d__6.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:Zeile 64.
[Error- 1:20:51 PM] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible. Processing of message 'textDocument/codeAction' failed with error: 'Das angegebene Argument liegt außerhalb des gültigen Wertebereichs. Parametername: span' Details: System.ArgumentOutOfRangeException: Das angegebene Argument liegt außerhalb des gültigen Wertebereichs. Parametername: span bei Microsoft.Dynamics.Nav.CodeAnalysis.SyntaxNode.FindNode(TextSpan span, Boolean findInsideTrivia, Boolean getInnermostNodeForTie) in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Syntax\SyntaxNode.cs:Zeile 1240. bei Microsoft.Dynamics.Nav.CodeAnalysis.ConvertIfToCase.ConvertIfToCaseCodeRefactoringProvider.
d__0.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\CodeRefactoring\Providers\ConvertIfToCase\ConvertIfToCaseCodeRefactoringProvider.cs:Zeile 28. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.CodeAnalysis.CodeRefactoring.CodeRefactoringService. d__5.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\CodeRefactoring\CodeRefactoringService.cs:Zeile 87. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.CodeAnalysis.CodeRefactoring.CodeRefactoringService. d__4.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\CodeRefactoring\CodeRefactoringService.cs:Zeile 44. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.CodeActionRequestHandler. d__9.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\CodeActionRequestHandler.cs:Zeile 70. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase`1. d__9.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:Zeile 43. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry. d__6.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:Zeile 64.
[Error - 1:21:27 PM] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible. Processing of message 'textDocument/hover' failed with error: 'Position: 4, FullSpan: (0..0) Parametername: position' Details: System.ArgumentOutOfRangeException: Position: 4, FullSpan: (0..0) Parametername: position bei Microsoft.Dynamics.Nav.CodeAnalysis.SyntaxNode.FindToken(Int32 position) in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Syntax\SyntaxNode.cs:Zeile 763. bei Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.DocumentExtensions.
d__19.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\Shared\Extensions\DocumentExtensions.cs:Zeile 360. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.DocumentExtensions. d__7.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\Shared\Extensions\DocumentExtensions.cs:Zeile 164. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.HoverRequestHandler. d__3.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\HoverRequestHandler.cs:Zeile 44. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase`1. d__9.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:Zeile 43. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry. d__6.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:Zeile 64.
[Error- 1:21:31 PM] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible. Processing of message 'textDocument/hover' failed with error: 'Position: 5, FullSpan: (0..0) Parametername: position' Details: System.ArgumentOutOfRangeException: Position: 5, FullSpan: (0..0) Parametername: position bei Microsoft.Dynamics.Nav.CodeAnalysis.SyntaxNode.FindToken(Int32 position) in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Syntax\SyntaxNode.cs:Zeile 763. bei Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.DocumentExtensions.
d__19.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\Shared\Extensions\DocumentExtensions.cs:Zeile 360. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.DocumentExtensions. d__7.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\Shared\Extensions\DocumentExtensions.cs:Zeile 164. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.HoverRequestHandler. d__3.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\HoverRequestHandler.cs:Zeile 44. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase`1. d__9.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:Zeile 43. --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde --- bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) bei Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry. d__6.MoveNext() in C:\a\810\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:Zeile 64.
error AL0999: Internal error: Der Typeninitialisierer für "Microsoft.Dynamics.Nav.CodeAnalysis.TriggerDefinitions" hat eine Ausnahme verursacht
Note: Error AL0999 comes up numerous times.
To Reproduce Steps and/or AL code to reproduce the behavior:
-
Pull docker container (daily builds) as of today 6 Feb 2019
-
Uninstall AL Language, delete extension folder in "C:\Users\CurrentUser\vscode\extensions"
-
Install VSIX from this container.
-
Create new project with successfully compiled app objects for current version. In the AL settings.json, I deactivated/activated all of the following, to no avail.
"[al]": {
"editor.codeLens": false }, "al.codeAnalyzers": [ "${CodeCop}", "${AppSourceCop}", ], "al.enableCodeAnalysis": false
Expected behavior
I wanted to compile the existing app against the preview due in April.
Screenhots:
Note: This also comes up numerous times.
Versions:
- AL Langauge: 2.1.91153
Visual Studio Code Version: 1.30.2 (system setup) Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8 Date: 2019-01-07T22:54:13.295Z Electron: 2.0.12 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 OS: Windows_NT x64 10.0.14393
- Business Central: 14.0.27940
I see the same behavior on my development environment.
Hi @Kowa63, thank you for reporting this issue. We also noticed it internally and we will fix it.
Hi @qutreson , thanks for the reply. Is there any other recent build in the master branch which does not have this defect and can serve as a suitable test environment for the upcoming runtime 3.0 until the bug is fixed?
We are still investigating what the issue for this bug is. We will prioritize fixing it. We noticed the bug at the start of the week, if you pick up a build that is older than this, you may find an AL version which does not have this issue.
In order to speed up our investigation, can you share a code snippet that is triggering this bug in your case?
A build no. of last week would be helpful, as I need to indicate this precisely for the image pull.
I'm afraid that the code is copyrighted. That is a working app in AppSource.
https://appsource.microsoft.com/en-us/product/dynamics-365-business-central/PUBID.gbedv_gmbh|AID.opplus365-v0|PAPPID.88cf5d4c-8afc-4a98-9cb7-212196c51d74-preview?flightCodes=opplus365preview&pub_source=email&pub_status=success
It does not appear to be a specific snippet causing these errors, all objects files are marked with the wavy line right from the start in line 1.
If you send me your email adress, I can send you some of the project files, but I can't share this publicly.
As mentioned, all objects are affected, only in case of tableextensions, a different error message is shown as I noticed today.

I just tried an old build 14.0.26496 from 5 Dec 2018 for the simple reason that @freddydk mentions that number here: https://blogs.msdn.microsoft.com/freddyk/2018/12/05/business-central-build-numbers/ VSIX 2.1.70025 Even that old version already shows the same error message
error AL0999: Internal error: Der Typeninitialisierer für "Microsoft.Dynamics.Nav.CodeAnalysis.TriggerDefinitions" hat eine Ausnahme verursacht.
Hi @Kowa63, I think you are facing two different issues here. The one you originally reported looks like a bug that got recently introduced in the compiler. The second issue that you are facing now seems to be related to the loading of the assembly System.ValueTuple (see #2431). Can you make sure you have .NET 4.7 or higher installed on your machine?
Hi @qutreson, thanks a lot , problem solved, .NET 4.6 was still running on the virtual server, and after an update to 4.7.2 all error messages are gone and the compiler is working again.
If the compiler is dependent on a specific .NET version, isn't it possible that it checks that before it sets off to work and generates a sensible error message instead of countless misguiding ones?