microsoft / vscode-asa

Azure Stream Analytics In VSCode
Creative Commons Attribution 4.0 International
10 stars 19 forks source link

Cannot read properties of null (reading 'runtime') #64

Open mustafakmal opened 2 years ago

mustafakmal commented 2 years ago

Extension Version: 1.2

I am unable to compile my .asaql script.

I am trying to run a simple local test run with a CSV file as an input { "InputAlias": "Input1", "Type": "Data Stream", "Format": "Csv", "FilePath": "../sample_data.csv", "ScriptType": "InputMock" }

I have dot net 5.0.407 installed and added to the PATH.

I am getting the following error [Error] .NET Core version not found, please install from https://dotnet.microsoft.com/download [Error] Error occurred during executing command: Run locally , error details: Cannot read properties of null (reading 'runtime')

mustafakmal commented 2 years ago

Update I have downgraded the extension version to 1.13. This has resolved the issue.

Any suggestion on fixing this with the latest version?

pengyuli-ms commented 2 years ago

Hi @mustafakmal , could you tell me which DotNet environments installed on your machine? Specifically, running these 2 commands: dotnet --list-sdks and dotnet --list-runtimes. Thanks a lot!

pletnes commented 2 years ago

I had the exact same symptoms with dotnet 6.0.103 installed. I also installed dotnet 3.0.3 but this did not work, either. Is this viscose plugin even up to date? The dotnet 3.0.3 version, requested by the vscode plugin, is also out of support since march 2020, according to https://en.wikipedia.org/wiki/.NET

Is this plugin maintained or abandoned?

pletnes commented 2 years ago

I have tried the last three vscode extension versions, no luck on that approach, either.

xujxu commented 2 years ago

Hi,

Sorry for the inconvenience. We do update this plugin often as we just released version 1.2.0. However, it has been upgraded to dotnet 6 yet, but it's already planned to do the upgrade. Actually, ASA VS code plugin is our top priority tool for ASA which is being invested much. So, please stay tuned for the further update.

As for this specific issue, our expert pengyuli is working on it. Please kindly provide the information he needs so that we could investigate further. Thanks for your great support!

pletnes commented 2 years ago

Absolutely, good to hear - let me know how I can contribute, I need this for my work.

xujxu commented 2 years ago

@pletnes would you mind to leave your contact info (e.g. email address)? so that we could connect you for the repro details because we can't repro it locally. Thanks.

pengyuli-ms commented 2 years ago

Hi @pletnes , could you run dotnet --list-sdks and dotnet --list-runtimes on your local machine, I'd like to create the same DotNet environment with you and repro this issue, thanks!

pletnes commented 2 years ago

@xujxu where do I put my email? I'd rather not post it here in the issues.

pletnes commented 2 years ago

@pengyuli-ms Hi, I have 2 installed - homebrew-installed and official-installer-installed. Details from my shell below:

sh-3.2$ dotnet --version
6.0.103
sh-3.2$ dotnet --list-sdks
6.0.103 [/opt/homebrew/Cellar/dotnet/6.0.103/libexec/sdk]
sh-3.2$ dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.3 [/opt/homebrew/Cellar/dotnet/6.0.103/libexec/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.3 [/opt/homebrew/Cellar/dotnet/6.0.103/libexec/shared/Microsoft.NETCore.App]
sh-3.2$
sh-3.2$ /usr/local/share/dotnet/dotnet --version
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
sh-3.2$ /usr/local/share/dotnet/dotnet --list-sdks
sh-3.2$ /usr/local/share/dotnet/dotnet --list-runtimes
Microsoft.NETCore.App 3.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

As you can see, the 3.0.3 version is runtime-only. This is the version linked to by the plugin. Also it is in a nonstandard PATH so I've been experimenting with symlinks and other tricks to get vscode to find it. This seems to work but just gives a slightly different error message. Paradoxically, vscode runs dotnet --version on the 3.0.3 version, which does not support this command line argument!

pengyuli-ms commented 2 years ago

Hi @pletnes , thanks so much for your assistance! I have two things to share:

  1. We indeed didn't support .Net 6 yet, but it is our top priority, we will release a new version to support it in a month or two.
  2. If you have DotNet runtime 3.0.3 installed and you succeed to globally redirect your dotnet --list-runtimes to 3.0.3, it should work fine, could you share me that different error message you met?
pengyuli-ms commented 2 years ago

Hi @pletnes , I tried the same DotNet environments as yours, both on Windows and MacOS, and the result is: Windows works fine, MacOS pop up the same error. The vscode on MacOS didn't even recognize dotnet --list-runtimes at all, we will figure out why and fix it as soon as possible.

pletnes commented 2 years ago

Great, looks like you're able to reproduce. Looking forward to the fix!

mustafakmal commented 2 years ago

My issue was also that I did not have the dotnet 3.03 runtime installed. Once installed I am now able to use the latest version of the extension and it works correctly.

pletnes commented 2 years ago

Thanks for letting me know @mustafakmal - for me, this does not work. As @pengyuli-ms notes, this does not work on macos, and he's investigating. I assume you're on Windows or Linux?

mustafakmal commented 2 years ago

No problem. Yeah I am using WSL2 on Windows.

AndreasHassing commented 2 years ago

I had this problem in our GitHub Codespaces for a project that uses ASA. Our Codespaces configuration runs Ubuntu Focal (20.04).

The mitigation there was simple, just add the following to devcontainer.json:

-"features": {}
+"features": {
+  "dotnet": "3.1"
+}

Looking forward to .NET 6 support 😊.

pengyuli-ms commented 2 years ago

@AndreasHassing Thanks for the suggestions! And of course .net6 support will be included in our next release.