(1,1): error AL0999: Internal error: The type initializer for 'Microsoft.Dynamics.Nav.CodeAnalysis.TriggerDefinitions' threw an exception.
///Description/// Upon compiling extension, package failed to be created with the error in subject. After a few minutes, the below output error gets thrown.
///Version details///* AL 2.1.68304 AL 2.0.56865 Both version is install and enabled. Not sure how. bcinsider.azurecr.io/bcsandbox-master:th
///Output error///
[Error - 7:47:23 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: 707, FullSpan: (0..0)
Parameter name: position'
Details:
System.ArgumentOutOfRangeException: Position: 707, FullSpan: (0..0)
Parameter name: position
at Microsoft.Dynamics.Nav.CodeAnalysis.SyntaxNode.FindToken(Int32 position) in C:\a\1051\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Syntax\SyntaxNode.cs:line 896
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.DocumentExtensions.<GetTokenAtPositionAsync>d__18.MoveNext() in C:\a\1051\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\Shared\Extensions\DocumentExtensions.cs:line 332
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.DocumentExtensions.<IsPositionNotOnTokenTrivia>d__7.MoveNext() in C:\a\1051\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\Shared\Extensions\DocumentExtensions.cs:line 168
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.HoverRequestHandler.<HandleAsync>d__3.MoveNext() in C:\a\1051\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\HoverRequestHandler.cs:line 40
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase1.<HandleAsync>d__10.MoveNext() in C:\a\1051\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:line 45
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry.<Process>d__6.MoveNext() in C:\a\1051\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:line 58
Hi @lhtan-dev, are you using a workspace with multiple AL projects?
Nope. Just a single project.
Can you also disable successively one of the two AL extensions you have installed to see if it fixes your issue? You should always have one AL extension enabled at the time in VS Code. If that still reproduces with AL 2.1.68304, looking at the stack trace, the error seems to come from hovering over something in your project. Can you try finding out some code snippet that would reproduce the issue?
Disabled AL 2.1 and the project builds successfully. //AL 2.0 is working fine.
DIsabled AL 2.0 and the project fails to build. //AL 2.1 is the one with the issue. AL 2.1 is the vsix that comes with the docker image.

Minutes later, this pops up. 7 of these errors to be exact. With all pointing to System.ArgumentOutOfRangeException : Position <#>
- Position : 105
- Position : 7
- Position : 10
- Position : 7
- Position : 3
- Position : 4
- Position : 3

Can you provide us with some code that reproduces this issue?
Can you provide us with some code that reproduces this issue?
I've created a fresh new project and the error still persist. Here's the code of HelloWorld.al and picture snippet of the error.
`// Welcome to your new AL extension. // Remember that object names and IDs should be unique across all extensions. // AL snippets start with t*, like tpageext - give them a try and happy coding!
pageextension 50100 CustomerListExt extends "Customer List" { trigger OnOpenPage(); begin Message('App published: Hello world'); end; }`

Can you provide us with some code that reproduces this issue?
Would you like to connect so i can share the environment access?
Hi @lhtan-dev ! Could you try the following:
- Uninstall the AL Language extension from VSCode.
- Restart VSCode
- Go to C:\Users{YourUserName}.vscode\extensions
- Delete all the folders that are related to the AL Language extension. They should be similar to microsoft.al-2.1.0
- Restart your environment
- Install the latest AL Language extension from the marketplace.
- Restart VSCode
- Open your project.
I have the same problem. I've updated to the latest insider build and tried to create a new project. The following error occurs immediately after downloading the symbols:
(1,1): error AL0999: Internal error: Der Typeninitialisierer für "Microsoft.Dynamics.Nav.CodeAnalysis.TriggerDefinitions" hat eine Ausnahme verursacht.
Image: bcinsider.azurecr.io/bcsandbox-master:de-ltsc2016 AL Language: 2.1.73375 VS Code: 1.30.0
Hi @lhtan-dev ! Could you try the following:
- Uninstall the AL Language extension from VSCode.
- Restart VSCode
- Go to C:\Users{YourUserName}.vscode\extensions
- Delete all the folders that are related to the AL Language extension. They should be similar to microsoft.al-2.1.0
- Restart your environment
- Install the latest AL Language extension from the marketplace.
- Restart VSCode
- Open your project.
Does not work for me. Build fails with the following error:

Hi @kwettermann ! Is it the build that is failing or publishing to the server?
@kwettermann it seems that you are using an extension that is older than what your server can support. If you are using a docker development preview, you should use the AL Language extension that comes with the docker image. If you are using a docker of a released version of BC 13, you should use the latest extension from the marketplace. We have updated the extension today, so make sure to update as well.
@kwettermann it seems that you are using an extension that is older than what your server can support. If you are using a docker development preview, you should use the AL Language extension that comes with the docker image. If you are using a docker of a released version of BC 13, you should use the latest extension from the marketplace. We have updated the extension today, so make sure to update as well.
Works now. Thank you.
I'm having the same problem, I've downlaoded the last AL extension from the market, and error. I've isntalled the extension from the vsix of the docker, and error.
I'm also trying to redownlaod the symbols, and I get this error:
[Error - 12:03: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 'al/downloadSymbols' failed with error: 'Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'
Details:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.Extensions.NavServerRequestHandler1.1.HandleAsync(T request, Int32 requestId, CancellationToken cancellationToken)
at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase1.
WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
[Error - 12:03:53 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: 950, FullSpan: (0..0)
Parameter name: position'
Details:
System.ArgumentOutOfRangeException: Position: 950, FullSpan: (0..0)
Parameter name: position
at Microsoft.Dynamics.Nav.CodeAnalysis.SyntaxNode.FindToken(Int32 position) in F:\a\8\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Syntax\SyntaxNode.cs:line 763
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.DocumentExtensions.
`
@aetxebarria the stacktrace appears to be different. I think your issue was caused by not having .NET Framework 4.7.2 installed.