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

System.NullReferenceException when clicking "Show at startup" on AL Home / Workspace file updated #7356

Closed
NKarolak opened this issue Apr 3, 2023 · 6 comments
Labels
accepted al-explorer ships-in-future-update The issue is fixed in our 'master' branch and will ship in the next PREVIEW release

Comments

@NKarolak
Copy link

NKarolak commented Apr 3, 2023

Please include the following with each issue:

1. Describe the bug
Setting "Show at startup" on the AL Home page throws an error in the Output put.

2. To Reproduce

  1. Open a project by a workspace file while still using AL Language v10.x.
  2. Update your AL Language to v11 from Marketplace
  3. Reload Window --> This will open the AL Explorer and AL Home tabs.
  4. On the AL Home tab, scroll down and click on "Show at startup"

3. Expected behavior
No error in output. No update of the workspace file.

4. Actual behavior
Error in Output tab:

[Error - 3:48:59 PM] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible.
Processing of message 'workspace/didChangeConfiguration' 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.EditorServices.Protocol.LanguageServer.DidChangeConfigurationRequestHandler.HandleAsync(SettingsRequest request, Int32 requestId, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\DidChangeConfigurationRequestHandler.cs:line 38
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase`1.HandleAsync(JToken requestContents, Int32 requestId, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:line 103
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry.Process(Message message) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:line 108

However, the workspace file has been updated:
image
But when I undo this change and reload VS Code, the change is back.

5. Versions:

  • AL Language: 11.0.779295
  • Visual Studio Code: 1.77.0
@NKarolak
Copy link
Author

NKarolak commented Apr 3, 2023

I unticked the option on the AL Home page, and put the following in to my user settings.json:

 "al.showHomeAtStartup": "Always",
 "al.showExplorerAtStartup": "Always",

However, it has no effect: When I reopen VS Code, the tabs are not shown.

image

Though my workspace file is unchanged (no al home/explorer property set):
image

Edit:
After disabling the BusinessCentral.LinterCop extension and "Reload Window", the tabs now appear on startup as expected. 💇‍♂️
Anyway, the issue described in the first post is still acute.

@NKarolak NKarolak changed the title System.NullReferenceException when clicking "Show at startup" on AL Home System.NullReferenceException when clicking "Show at startup" on AL Home / Workspace file updated Apr 4, 2023
@jose-lloret
Copy link

I'm getting a very similar error when the AL extensión starts to load a project:

Processing of message 'workspace/didChangeConfiguration' 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.EditorServices.Protocol.LanguageServer.DidChangeConfigurationRequestHandler.HandleAsync(SettingsRequest request, Int32 requestId, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\DidChangeConfigurationRequestHandler.cs:line 38
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase`1.HandleAsync(JToken requestContents, Int32 requestId, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:line 84
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry.Process(Message message) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:line 86

VS Code: 1.78.2 (system setup)
AL Extension: v11.0.787898

My workspace file is this:

{
    "folders": [
        {
            "path": "GsiBaseHorto"
        },
        {
            "path": ".alpackages"
        }
    ],
    "settings": {
    }
}

@jose-lloret
Copy link

Sorry. I've just discovered a syntax error in the app.json. After resolving it, the workspace loads without problems.

I'm getting a very similar error when the AL extensión starts to load a project:

Processing of message 'workspace/didChangeConfiguration' 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.EditorServices.Protocol.LanguageServer.DidChangeConfigurationRequestHandler.HandleAsync(SettingsRequest request, Int32 requestId, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\DidChangeConfigurationRequestHandler.cs:line 38
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase`1.HandleAsync(JToken requestContents, Int32 requestId, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:line 84
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry.Process(Message message) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:line 86

VS Code: 1.78.2 (system setup) AL Extension: v11.0.787898

My workspace file is this:

{
    "folders": [
        {
            "path": "GsiBaseHorto"
        },
        {
            "path": ".alpackages"
        }
    ],
    "settings": {
    }
}

@SBalslev
Copy link
Contributor

@NKarolak can you reproduce on the latest versions? We're unable to reproduce at this point.

@NKarolak
Copy link
Author

NKarolak commented Jul 20, 2023

@SBalslev I can still reproduce it.

Here's what I tested right now:

  • VS Code 1.80.1
  • AL Language 11.5
  • User setting: "al.showExplorerAtStartup": "Never",
  • Open a project by workspace file (!)
  • Press F1 -> AL: Home
  • tick "Show at startup"

AL Output:

[Error - 1:35:41 PM] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible.
Processing of message 'workspace/didChangeConfiguration' 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.EditorServices.Protocol.LanguageServer.DidChangeConfigurationRequestHandler.HandleAsync(SettingsRequest request, Int32 requestId, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\DidChangeConfigurationRequestHandler.cs:line 38
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase`1.HandleAsync(JToken requestContents, Int32 requestId, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:line 103
   at Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry.Process(Message message) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:line 106

And Git indicates that the workspace file is still being updated with "al.showHomeAtStartup": "Always".

@SBalslev SBalslev removed the no-repro label Jul 25, 2023
@JesperSchulz JesperSchulz added the ships-in-future-update The issue is fixed in our 'master' branch and will ship in the next PREVIEW release label Aug 8, 2023
@JesperSchulz
Copy link

The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 23.0.11656.0 and VS Code Extension Version 12.0.842197.

If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo

For more details on code branches and docker images please read:
https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/
https://freddysblog.com/2020/06/25/working-with-artifacts/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted al-explorer ships-in-future-update The issue is fixed in our 'master' branch and will ship in the next PREVIEW release
Projects
None yet
Development

No branches or pull requests

6 participants