When I deploying by pressing Ctrl+F5
ERROR IN MESSAGE BOX
Could not publish the package to the server. See Visual Studio Code debug console for more details.
ERROR IN DEBUG CONSOLE
[2026-09-22 16:32:42.01] Error: Key not valid for use in specified state
[2026-09-22 16:32:42.01] Error: An internal error has occurred
When I try AL:Clear credentials cache
GETTING BELOW ERROR IN DEBUG CONSOLE
[2026-09-23 19:48:48.75] Error: Key not valid for use in specified state
[Error - 7:48:48 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/clearCredentialsCache' failed with error: 'Object reference not set to an instance of an object.'
Details:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Dynamics.Nav.Deployment.Authentication.AccessTokenManager.ClearCache(IEmitLogger logger) in X:\source\Prod\Microsoft.Dynamics.Nav.Deployment\Authentication\AccessTokenManager.cs:line 68
at Microsoft.Dynamics.Nav.Deployment.Http.CloudHttpClientFactory.ClearTokenCache(IEmitLogger logger) in X:\source\Prod\Microsoft.Dynamics.Nav.Deployment\Http\CloudHttpClientFactory.cs:line 375
at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.Extensions.ClearCredentialsCacheRequestHandler.HandleAsync(NavServerRequest1 request, Int32 requestId, CancellationToken cancellationToken) in X:\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\Extensions\ClearCredentialsCacheRequestHandler.cs:line 32 at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase2.HandleAsync(JToken requestContents, Int32 requestId, CancellationToken cancellationToken) in X:\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:line 90
at Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry.Process(Message message) in X:\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:line 84
When I deploying by pressing Ctrl+F5
ERROR IN MESSAGE BOX
Could not publish the package to the server. See Visual Studio Code debug console for more details.
ERROR IN DEBUG CONSOLE
[2026-09-22 16:32:42.01] Error: Key not valid for use in specified state
[2026-09-22 16:32:42.01] Error: An internal error has occurred
When I try AL:Clear credentials cache
GETTING BELOW ERROR IN DEBUG CONSOLE
[2026-09-23 19:48:48.75] Error: Key not valid for use in specified state
[Error - 7:48:48 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/clearCredentialsCache' failed with error: 'Object reference not set to an instance of an object.'
Details:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Dynamics.Nav.Deployment.Authentication.AccessTokenManager.ClearCache(IEmitLogger logger) in X:\source\Prod\Microsoft.Dynamics.Nav.Deployment\Authentication\AccessTokenManager.cs:line 68
at Microsoft.Dynamics.Nav.Deployment.Http.CloudHttpClientFactory.ClearTokenCache(IEmitLogger logger) in X:\source\Prod\Microsoft.Dynamics.Nav.Deployment\Http\CloudHttpClientFactory.cs:line 375
at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.Extensions.ClearCredentialsCacheRequestHandler.HandleAsync(NavServerRequest
1 request, Int32 requestId, CancellationToken cancellationToken) in X:\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\Extensions\ClearCredentialsCacheRequestHandler.cs:line 32 at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase2.HandleAsync(JToken requestContents, Int32 requestId, CancellationToken cancellationToken) in X:\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:line 90at Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry.Process(Message message) in X:\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:line 84