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

Error acquiring .NET runtime - VSCode Ubuntu 20.10 #31757

Closed
mrcteacher opened this issue Apr 11, 2021 · 6 comments · Fixed by dotnet/razor#3472
Closed

Error acquiring .NET runtime - VSCode Ubuntu 20.10 #31757

mrcteacher opened this issue Apr 11, 2021 · 6 comments · Fixed by dotnet/razor#3472
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-blazor-debugging This issue is related to debugging of Blazor WebAssembly apps
Milestone

Comments

@mrcteacher
Copy link

Repro steps:

  1. Dotnet 5.0
  2. Run dotnet new blazorwasm -p
  3. Open VSCode
  4. Click [Yes] on the message that includes additional assets
  5. Start debug [Launch and Debug Standalone Blazor WebAssembly App]
 Error!
The "args" argument must be of type object. Received type string ('--info')

There's a red status button - Error acquiring .NET runtimes!

Extension Version: 1.0.0
Error Message: The "args" argument must be of type object. Received type string ('--info')
Error Stack: TypeError [ERR_INVALID_ARG_TYPE]: The "args" argument must be of type object. Received type string ('--info')
at normalizeSpawnArguments (child_process.js:425:11)
at Object.spawnSync (child_process.js:575:16)
at Object. (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.0.0/dist/extension.js:157:67942)
at Generator.next ()
at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.0.0/dist/extension.js:157:64437
at new Promise ()
at n (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.0.0/dist/extension.js:157:64211)
at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.0.0/dist/extension.js:157:67865
at Object. (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.0.0/dist/extension.js:1:195071)
at Generator.next ()
at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.0.0/dist/extension.js:1:193638
at new Promise ()
at n (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.0.0/dist/extension.js:1:193412)
at Object.t.callWithErrorHandling (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.0.0/dist/extension.js:1:195019)
at Object. (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.0.0/dist/extension.js:157:67839)
at Generator.next ()
at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.0.0/dist/extension.js:157:64437
at new Promise ()
at n (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.0.0/dist/extension.js:157:64211)
at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.0.0/dist/extension.js:157:67797
at S._executeContributedCommand (/snap/code/60/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:86:106770)
at S._doExecuteCommand (/snap/code/60/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:86:105915)
at S.executeCommand (/snap/code/60/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:86:105821)
at Object.executeCommand (/snap/code/60/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:95:21932)
at Object. (/home/anonymous/.vscode/extensions/ms-dotnettools.blazorwasm-companion-1.0.0/dist/acquireDotnetInstall.js:29:35)
at Generator.next ()
at fulfilled (/home/anonymous/.vscode/extensions/ms-dotnettools.blazorwasm-companion-1.0.0/dist/acquireDotnetInstall.js:9:58)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:97:5)

@mrcteacher
Copy link
Author

App runs fine, but cannot debug

@sfoslund
Copy link
Member

@captainsafia I believe this is an issue with how the blazor extension is calling into the ensureDotnetDependencies command: https://github.com/dotnet/aspnetcore-tooling/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode.BlazorWasmDebuggingExtension/src/acquireDotnetInstall.ts#L23. We expect the arguments passed in IDotnetEnsureDependenciesContext to be of type cp.SpawnSyncOptionsWithStringEncoding, and you're passing a string: https://github.com/dotnet/vscode-dotnet-runtime/blob/976e80efc036f326c58163d39fbfbd1c24064e46/vscode-dotnet-runtime-library/src/IDotnetEnsureDependenciesContext.ts

Also, I would suggest wrapping this call in some sort of try catch to produce a better error message and since a failure on this command does not necessarily mean that the rest of the install has failed.

@captainsafia
Copy link
Member

@sfoslund You can transfer this issue to the aspnetcore repo for tracking there.

@sfoslund sfoslund transferred this issue from dotnet/vscode-dotnet-runtime Apr 13, 2021
@captainsafia captainsafia added area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-blazor-debugging This issue is related to debugging of Blazor WebAssembly apps labels Apr 13, 2021
@captainsafia captainsafia added this to the Next sprint planning milestone Apr 13, 2021
@ghost
Copy link

ghost commented Apr 13, 2021

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. Because it's not immediately obvious that this is a bug in our framework, we would like to keep this around to collect more feedback, which can later help us determine the impact of it. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@kattunga
Copy link

Is there any known workarround?
By the moment the only solution that I found is to use a combination of code-insiders with a previous c# extension (version 1.23.9)

@captainsafia
Copy link
Member

@kattunga We'll have a fix for this out soon!

@ghost ghost locked as resolved and limited conversation to collaborators May 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-blazor-debugging This issue is related to debugging of Blazor WebAssembly apps
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants