microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
227 stars 11 forks source link

[BUG] .NET server STDERR: System.IO.FileNotFoundException #1496

Open dgf17541 opened 1 week ago

dgf17541 commented 1 week ago

Describe the Issue

I am trying to use unzipped .net binaries with vscode(portable mode). I have used a batch file to set the environment variables and add the dotnet.exe folder to the PATH before opening vscode. However, the extension is not working properly after pressing "Create .NET Project".

Steps To Reproduce

  1. install extensions "C# Dev Kit".
  2. after loaded, press the "Create .NET Project" button.
  3. nothing happen (no warning/error message box)

Expected Behavior

poping up what project to be created and starting new .net project

Environment Information

OS: Window 11 VS Code Version: 1.93.1 (portable mode) Extension Version: C# Dev Kit (v1.10.18) (also tried pre-released v1.11.11)

Batch that I use to open vscode:

@echo off
set "currentPath=C:\Users\User1\Desktop\_files\VSCode"
set "vscodefolder=%currentPath%\VSCode-win32-x64-1.93.1"

set "DOTNET_ROOT=%currentPath%\dotnet-sdk-8.0.401-win-x64"
set "DOTNET_INSTALL_DIR=%DOTNET_ROOT%"
set "DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=%DOTNET_ROOT%"
set "DOTNET_CLI_HOME=%currentPath%\dotnet_related\user_profile"

set "PATH=%DOTNET_ROOT%;%DOTNET_CLI_HOME%\.dotnet\tools;%vscodefolder%\bin;%PATH%"

start "" "%vscodefolder%\Code.exe"

"dotnet --info" command result in terminal in vscode:

.NET SDK:
 Version:           8.0.401
 Commit:            811edcc344
 Workload version:  8.0.400-manifests.b6724b7a
 MSBuild version:   17.11.4+37eb419ad

執行階段環境:
 OS Name:     Windows
 OS Version:  10.0.22631
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Users\User1\Desktop\_files\VSCode\dotnet-sdk-8.0.401-win-x64\sdk\8.0.401\

安裝的 .NET 工作負載:
設為在安裝新資訊清單時使用 loose manifests。
沒有已安裝的工作負載可顯示。

Host:
  Version:      8.0.8
  Architecture: x64
  Commit:       08338fcaa5

.NET SDKs installed:
  8.0.401 [C:\Users\User1\Desktop\_files\VSCode\dotnet-sdk-8.0.401-win-x64\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.8 [C:\Users\User1\Desktop\_files\VSCode\dotnet-sdk-8.0.401-win-x64\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.8 [C:\Users\User1\Desktop\_files\VSCode\dotnet-sdk-8.0.401-win-x64\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 8.0.8 [C:\Users\User1\Desktop\_files\VSCode\dotnet-sdk-8.0.401-win-x64\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]     

Environment variables:
  DOTNET_ROOT       [C:\Users\User1\Desktop\_files\VSCode\dotnet-sdk-8.0.401-win-x64]

global.json file:
  Not found

C# OUTPUT:

Using dotnet configured on PATH
Dotnet path: C:\Users\User1\Desktop\_files\VSCode\dotnet-sdk-8.0.401-win-x64\dotnet.exe
Activating C# + C# Dev Kit...
waiting for named pipe information from server...
[stdout] {"pipeName":"\\\\.\\pipe\\51b75c70"}
received named pipe information from server
attempting to connect client to server...
client has connected to server
[Info  - 6:40:22 PM] [Program] Language server initialized

C# Dev Kit OUTPUT:

Starting Spawn .NET server...
Using preinstalled .NET runtime at "C:\Users\User1\Desktop\_files\VSCode\dotnet-sdk-8.0.401-win-x64\dotnet.exe" to load Dev Kit processes.
Found installed dotnet location "C:\Users\User1\Desktop\_files\VSCode\dotnet-sdk-8.0.401-win-x64\dotnet.exe" to load projects.
.NET server STDERR: Unhandled exception. 
.NET server STDERR: System.IO.FileNotFoundException: �t�Χ䤣����w���ɮסC (0x80070002)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at Microsoft.ServiceHub.Utility.Shared.Common.StartProcessWindows(ProcessStartInfo startInfo, EventHandler onExited, EventHandler onDisposed)
   at Microsoft.ServiceHub.Client.HubControllerClient.StartAsync(ServiceHubConfig config, String clientName, CancellationToken cancellationToken)
   at Microsoft.ServiceHub.Client.HubClient.LaunchOrFindControllerAsync()
   at Microsoft.ServiceHub.Client.HubClient.GetLocationServiceAsync()
   at Microsoft.ServiceHub.Utility.Shared.ServiceHubRetry.ExecuteAsync[TReturnType](Func`1 actionToExecute, TraceSource logger, ServiceHubRetryConfiguration`1 serviceHubRetryConfiguration, CancellationToken cancellationToken)
   at Microsoft.ServiceHub.Utility.Shared.ServiceHubRetry.ExecuteAsync[TReturnType](Func`1 actionToExecute, TraceSource logger, ServiceHubRetryConfiguration`1 serviceHubRetryConfiguration, CancellationToken cancellationToken)
   at Microsoft.ServiceHub.Client.HubClient.GetThisAsRemoteServiceBrokerAsync()
   at Microsoft.VisualStudio.Server.ServiceBroker.Program.RunAsync(Stream rpcStream, String bridgePipeName, ExportProvider exportProvider, Boolean includeServiceHub, String serviceHubConfigPath, Func`2 traceSourceFactory, TraceSource traceSource, TelemetrySession telemetrySession, TelemetryEvent perfTelemetryEvent, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Server.ServiceBroker.Program.RunAsync(Stream rpcStream, String bridgePipeName, ExportProvider exportProvider, Boolean includeServiceHub, String serviceHubConfigPath, Func`2 traceSourceFactory, TraceSource traceSource, TelemetrySession telemetrySession, TelemetryEvent perfTelemetryEvent, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Server.ServiceBroker.Program.<>c.<<BuildCommandLine>b__7_1>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass20_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<CancelOnProcessTermination>b__1_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(IConsole console)
   at System.CommandLine.Parsing.ParseResultExtensions.InvokeAsync(ParseResult parseResult, IConsole console)
   at System.CommandLine.Parsing.ParserExtensions.InvokeAsync(Parser parser, String[] args, IConsole console)
   at Microsoft.VisualStudio.Server.ServiceBroker.Program.Main(String[] args)
   at Microsoft.VisualStudio.Server.ServiceBroker.Program.<Main>(String[] args)

Error occurred in launchDotNetServer: Error: Stream terminated before required bytes were read.
Failed at 'Spawn .NET server' (5224ms) with error: Error: Stream terminated before required bytes were read.
.NET server exited with 3762504530

C# LSP Trace Logs:

Extension vscode.bat does not contribute csharpExtensionLoadPaths
Extension vscode.clojure does not contribute csharpExtensionLoadPaths
Extension vscode.coffeescript does not contribute csharpExtensionLoadPaths
Extension vscode.configuration-editing does not contribute csharpExtensionLoadPaths
Extension vscode.cpp does not contribute csharpExtensionLoadPaths
Extension vscode.csharp does not contribute csharpExtensionLoadPaths
Extension vscode.css does not contribute csharpExtensionLoadPaths
Extension vscode.css-language-features does not contribute csharpExtensionLoadPaths
Extension vscode.dart does not contribute csharpExtensionLoadPaths
Extension vscode.debug-auto-launch does not contribute csharpExtensionLoadPaths
Extension vscode.debug-server-ready does not contribute csharpExtensionLoadPaths
Extension vscode.diff does not contribute csharpExtensionLoadPaths
Extension vscode.docker does not contribute csharpExtensionLoadPaths
Extension vscode.emmet does not contribute csharpExtensionLoadPaths
Extension vscode.extension-editing does not contribute csharpExtensionLoadPaths
Extension vscode.fsharp does not contribute csharpExtensionLoadPaths
Extension vscode.git does not contribute csharpExtensionLoadPaths
Extension vscode.git-base does not contribute csharpExtensionLoadPaths
Extension vscode.github does not contribute csharpExtensionLoadPaths
Extension vscode.github-authentication does not contribute csharpExtensionLoadPaths
Extension vscode.go does not contribute csharpExtensionLoadPaths
Extension vscode.groovy does not contribute csharpExtensionLoadPaths
Extension vscode.grunt does not contribute csharpExtensionLoadPaths
Extension vscode.gulp does not contribute csharpExtensionLoadPaths
Extension vscode.handlebars does not contribute csharpExtensionLoadPaths
Extension vscode.hlsl does not contribute csharpExtensionLoadPaths
Extension vscode.html does not contribute csharpExtensionLoadPaths
Extension vscode.html-language-features does not contribute csharpExtensionLoadPaths
Extension vscode.ini does not contribute csharpExtensionLoadPaths
Extension vscode.ipynb does not contribute csharpExtensionLoadPaths
Extension vscode.jake does not contribute csharpExtensionLoadPaths
Extension vscode.java does not contribute csharpExtensionLoadPaths
Extension vscode.javascript does not contribute csharpExtensionLoadPaths
Extension vscode.json does not contribute csharpExtensionLoadPaths
Extension vscode.json-language-features does not contribute csharpExtensionLoadPaths
Extension vscode.julia does not contribute csharpExtensionLoadPaths
Extension vscode.latex does not contribute csharpExtensionLoadPaths
Extension vscode.less does not contribute csharpExtensionLoadPaths
Extension vscode.log does not contribute csharpExtensionLoadPaths
Extension vscode.lua does not contribute csharpExtensionLoadPaths
Extension vscode.make does not contribute csharpExtensionLoadPaths
Extension vscode.markdown does not contribute csharpExtensionLoadPaths
Extension vscode.markdown-language-features does not contribute csharpExtensionLoadPaths
Extension vscode.markdown-math does not contribute csharpExtensionLoadPaths
Extension vscode.media-preview does not contribute csharpExtensionLoadPaths
Extension vscode.merge-conflict does not contribute csharpExtensionLoadPaths
Extension vscode.microsoft-authentication does not contribute csharpExtensionLoadPaths
Extension ms-vscode.js-debug does not contribute csharpExtensionLoadPaths
Extension ms-vscode.js-debug-companion does not contribute csharpExtensionLoadPaths
Extension ms-vscode.vscode-js-profile-table does not contribute csharpExtensionLoadPaths
Extension vscode.builtin-notebook-renderers does not contribute csharpExtensionLoadPaths
Extension vscode.npm does not contribute csharpExtensionLoadPaths
Extension vscode.objective-c does not contribute csharpExtensionLoadPaths
Extension vscode.perl does not contribute csharpExtensionLoadPaths
Extension vscode.php does not contribute csharpExtensionLoadPaths
Extension vscode.php-language-features does not contribute csharpExtensionLoadPaths
Extension vscode.powershell does not contribute csharpExtensionLoadPaths
Extension vscode.pug does not contribute csharpExtensionLoadPaths
Extension vscode.python does not contribute csharpExtensionLoadPaths
Extension vscode.r does not contribute csharpExtensionLoadPaths
Extension vscode.razor does not contribute csharpExtensionLoadPaths
Extension vscode.references-view does not contribute csharpExtensionLoadPaths
Extension vscode.restructuredtext does not contribute csharpExtensionLoadPaths
Extension vscode.ruby does not contribute csharpExtensionLoadPaths
Extension vscode.rust does not contribute csharpExtensionLoadPaths
Extension vscode.scss does not contribute csharpExtensionLoadPaths
Extension vscode.search-result does not contribute csharpExtensionLoadPaths
Extension vscode.shaderlab does not contribute csharpExtensionLoadPaths
Extension vscode.shellscript does not contribute csharpExtensionLoadPaths
Extension vscode.simple-browser does not contribute csharpExtensionLoadPaths
Extension vscode.sql does not contribute csharpExtensionLoadPaths
Extension vscode.swift does not contribute csharpExtensionLoadPaths
Extension vscode.theme-abyss does not contribute csharpExtensionLoadPaths
Extension vscode.theme-defaults does not contribute csharpExtensionLoadPaths
Extension vscode.theme-kimbie-dark does not contribute csharpExtensionLoadPaths
Extension vscode.theme-monokai does not contribute csharpExtensionLoadPaths
Extension vscode.theme-monokai-dimmed does not contribute csharpExtensionLoadPaths
Extension vscode.theme-quietlight does not contribute csharpExtensionLoadPaths
Extension vscode.theme-red does not contribute csharpExtensionLoadPaths
Extension vscode.vscode-theme-seti does not contribute csharpExtensionLoadPaths
Extension vscode.theme-solarized-dark does not contribute csharpExtensionLoadPaths
Extension vscode.theme-solarized-light does not contribute csharpExtensionLoadPaths
Extension vscode.theme-tomorrow-night-blue does not contribute csharpExtensionLoadPaths
Extension vscode.tunnel-forwarding does not contribute csharpExtensionLoadPaths
Extension vscode.typescript does not contribute csharpExtensionLoadPaths
Extension vscode.typescript-language-features does not contribute csharpExtensionLoadPaths
Extension vscode.vb does not contribute csharpExtensionLoadPaths
Extension vscode.xml does not contribute csharpExtensionLoadPaths
Extension vscode.yaml does not contribute csharpExtensionLoadPaths
Extension ms-dotnettools.csdevkit does not contribute csharpExtensionLoadPaths
Extension ms-dotnettools.csharp does not contribute csharpExtensionLoadPaths
Extension ms-dotnettools.vscode-dotnet-runtime does not contribute csharpExtensionLoadPaths
smitpatel commented 5 hours ago

@AArnott - This does look like that server process is starting to launch.

AArnott commented 2 hours ago

@ryantoth3 for servicehub failing

AArnott commented 2 hours ago

It sounds like a missing file that should have been installed. Can you remove the C# Dev Kit extension and reinstall?