dotnet / vscode-dotnet-runtime

VSCode Extension for Installing .NET via VS Code
MIT License
140 stars 265 forks source link

'file' argument error with version 2.0.249 of the ms-dotnettools.csharp C# extension #1007

Closed CyberGuerro closed 1 year ago

CyberGuerro commented 1 year ago

Repro steps:

  1. Update or install the ".NET Install Tool for Extension Authors"
  2. Reload VSCode with opened project or open project after reload

Extension Version: 1.0.0 Error Message: The "file" argument must be of type string. Received an instance of Object Error Stack: TypeError: The "file" argument must be of type string. Received an instance of Object at new NodeError (node:internal/errors:387:5) at validateString (node:internal/validators:121:11) at normalizeSpawnArguments (node:child_process:527:3) at Object.spawnSync (node:child_process:825:8) at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/dist/extension.js:2:1095661 at Generator.next () at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/dist/extension.js:2:1092018 at new Promise () at n (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/dist/extension.js:2:1091763) at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/dist/extension.js:2:1095584 at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/dist/extension.js:2:37962 at Generator.next () at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/dist/extension.js:2:36621 at new Promise () at n (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/dist/extension.js:2:36366) at t.callWithErrorHandling (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/dist/extension.js:2:37910) at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/dist/extension.js:2:1095578 at Generator.next () at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/dist/extension.js:2:1092018 at new Promise () at n (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/dist/extension.js:2:1091763) at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/dist/extension.js:2:1095512 at e.$vL.h (/opt/vscode/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:99:64085) at e.$vL.g (/opt/vscode/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:99:63073) at e.$vL.executeCommand (/opt/vscode/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:99:62973) at Object.executeCommand (/opt/vscode/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:117:20971) at t.DotnetRuntimeExtensionResolver. (/home/anonymous/.vscode/extensions/ms-dotnettools.csharp-2.0.249-linux-x64/dist/extension.js:2:1010140) at Generator.next () at s (/home/anonymous/.vscode/extensions/ms-dotnettools.csharp-2.0.249-linux-x64/dist/extension.js:2:1008463)

dusda commented 1 year ago

Getting this exact same problem right now, quite suddenly. It happened when I reloaded VS Code for an update to GitHub Copilot, and now won't go away.

incomingstick commented 1 year ago

I too am receiving this error. Here is my formatted error output:

Repro steps

  1. Update or install the ".NET Install Tool for Extension Authors"
  2. Reload VSCode

Extension Info

Extension ID: ms-dotnettools.vscode-dotnet-runtime Extension Version: v1.6.0 Error Message: The "file" argument must be of type string. Received an instance of Object Error Stack:

TypeError: The "file" argument must be of type string. Received an instance of Object
    at new NodeError (node:internal/errors:387:5)
    at validateString (node:internal/validators:121:11)
    at normalizeSpawnArguments (node:child_process:527:3)
    at Object.spawnSync (node:child_process:825:8)
    at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/src/extension.ts:153:31
    at Generator.next (<anonymous>)
    at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/src/DotnetCoreAcquistionId.ts:6:49
    at new Promise (<anonymous>)
    at n (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/src/DotnetCoreAcquistionId.ts:6:49)
    at callback (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/src/extension.ts:147:49)
    at next (/home/anonymous/.vscode/extensions/vscode-dotnet-runtime-library/dist/Utils/ErrorHandler.js:54:34)
    at Generator.next (<anonymous>)
    at /home/anonymous/.vscode/extensions/vscode-dotnet-runtime-library/dist/Utils/ErrorHandler.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/anonymous/.vscode/extensions/vscode-dotnet-runtime-library/dist/Utils/ErrorHandler.js:4:12)
    at callWithErrorHandling (/home/anonymous/.vscode/extensions/vscode-dotnet-runtime-library/dist/Utils/ErrorHandler.js:52:12)
    at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/src/extension.ts:147:15
    at Generator.next (<anonymous>)
    at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/src/DotnetCoreAcquistionId.ts:6:49
    at new Promise (<anonymous>)
    at n (/home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/src/DotnetCoreAcquistionId.ts:6:49)
    at /home/anonymous/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-1.6.0/src/extension.ts:146:196
    at e.$vL.h (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:99:64085)
    at e.$vL.g (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:99:63073)
    at e.$vL.executeCommand (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:99:62973)
    at Object.executeCommand (/opt/visual-studio-code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:117:20971)
    at t.DotnetRuntimeExtensionResolver.<anonymous> (/home/anonymous/.vscode/extensions/ms-dotnettools.csharp-2.0.249-linux-x64/dist/extension.js:2:1010140)
    at Generator.next (<anonymous>)
    at s (/home/anonymous/.vscode/extensions/ms-dotnettools.csharp-2.0.249-linux-x64/dist/extension.js:2:1008463)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
GlacierFox commented 1 year ago

I'm also getting this error when trying out the new MAUI extension on Debian 12. I watched your cool new video on the new extension @jfversluis on Youtube. You demonstrated how to use it on Windows and Mac, have you tried it on Linux yet and had this problem?

Retorikal commented 1 year ago

at s (/home/anonymous/.vscode/extensions/ms-dotnettools.csharp-2.0.249-linux-x64/dist/extension.js:2:1008463)

This extension has not been updated for the last 8 months or so, and the problem just pops up now out of nowhere. The problem is on whatever other extension is using it.

Based on this call stack I'd say downgrading ms-dotnettools.csharp extension might do the trick, will test soon

UPDATE: Downgrading ms-dotnettools.csharp to 2.0.248 removes this error

jfversluis commented 1 year ago

@GlacierFox I have seen this error on Linux indeed and while we should absolutely fix it, it’s not preventing me from successfully running and debugging a .NET MAUI project.

codingdave commented 1 year ago

I have the same issue:

VS Code Version: 1.80.1 Commit: 74f6148eb9ea00507ec113ec51c489d6ffb4b771 Date: 2023-07-12T17:22:25.257Z Electron: 22.3.14 ElectronBuildId: 21893604 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Linux x64 6.3.12-1-MANJARO


Extensions

Name: .NET Install Tool for Extension Authors Id: ms-dotnettools.vscode-dotnet-runtime Description: Allows acquisition of the .NET runtime specifically for VS Code extension authors. Version: 1.6.0 Publisher: Microsoft VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscode-dotnet-runtime

Name: C# Id: ms-dotnettools.csharp Description: Base language support for C# Version: 2.0.249 Publisher: Microsoft VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp

Name: C# Dev Kit Id: ms-dotnettools.csdevkit Description: Official C# extension from Microsoft Version: 0.2.100 Publisher: Microsoft VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit

Name: IntelliCode for C# Dev Kit Id: ms-dotnettools.vscodeintellicode-csharp Description: AI-assisted development for C# Dev Kit Version: 0.1.26 Publisher: Microsoft VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscodeintellicode-csharp

baronfel commented 1 year ago

Apologies about the delay here, folks. I'm going to treat this issue as the 'canonical' error for for the 33+ version that have been opened :) We've contacted the C# extension team about this issue and will keep you updated about the status as we know more. In the meantime, as @Retorikal mentioned above, please downgrade to 2.0.248 until we have a resolution.

ivanjx commented 1 year ago

why does the extension need to have its own runtime instead of using the globally available net runtime?

baronfel commented 1 year ago

@ivanjx this extension was originally designed to ship with the .NET Education Pack - for users that don't have admin control of their machines using a local install is a good thing! However, with the release of the C# Dev Kit we're working on adding support for the globally-installed SDK/Runtime in this extension. You can follow #1046 for the status on that. Once we add that functionality (and complete certain required internal processes like threat modeling, component governance, etc), we will release a new version of this extension that the C# extension (and other tools!) can use to share the global installs.

baronfel commented 1 year ago

The C# Extension team has pushed version 2.0.283 to the marketplace with a fix for this issue. Thanks everyone for reporting and for your patience as we get this solved. I'll close this issue now that a fixed version is available.