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
233 stars 13 forks source link

[BUG] Can't open c# project #679

Closed danielpastoor closed 3 weeks ago

danielpastoor commented 1 year ago

Describe the Issue

Error occurred in launchDotNetServer: Error: Stream terminated before required bytes were read. Failed at 'Spawn .NET server' (2192ms) with error: Error: Stream terminated before required bytes were read. Failed at 'Clear environment' (2192ms) with error: Error: Stream terminated before required bytes were read. Failed at 'Open a solution with environment service' (2193ms) with error: Error: Stream terminated before required bytes were read. .NET server exited with null Failed at 'Open a solution' (2194ms) with error: SolutionOpenError: Run into errors while opening the solution: Error: Stream terminated before required bytes were read. Failed to open solution SolutionOpenError: Run into errors while opening the solution: Error: Stream terminated before required bytes were read.

Steps To Reproduce

No response

Expected Behavior

No response

Environment Information

Mac os vscode: Version: 1.84.0 (Universal) devkit : v1.0.14

tpetrina commented 11 months ago

Additional information:

Starting Open a solution...
Starting Open a solution with environment service...
Starting Clear environment...
Starting Spawn .NET server...
Using preinstalled .NET runtime at "/usr/local/share/dotnet/dotnet"
Using runtime installed in SDK.
.NET server STDERR: Unhandled exception. System.IO.IOException: The system cannot open the device or file specified. : '-228456190-ServiceHubControllerSingleInstanceMutex'
   at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, Boolean& createdNew)
   at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
   at Microsoft.ServiceHub.Controller.Controller.MainAsync(String pipeName, String[] args, String serializedTelemetrySession, Nullable`1 controllerCooldownTimeout)
   at Microsoft.ServiceHub.Controller.Program.Main(String[] args)

.NET server STDERR: Unhandled exception. Microsoft.ServiceHub.Client.ControllerConnectionException: Controller terminated before accepting connections. Exit code: 134.
   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)

.NET server STDERR: [createdump] Invalid process id: task_for_pid(66253) FAILED (os/kern) failure (5)
[createdump] This failure may be because createdump or the application is not properly signed and entitled.
[createdump] Failure took 0ms

.NET server STDOUT: [createdump] Target process is alive

Error occurred in launchDotNetServer: Error: Stream terminated before required bytes were read.
Failed at 'Spawn .NET server' (5572ms) with error: Error: Stream terminated before required bytes were read.
Failed at 'Clear environment' (5573ms) with error: Error: Stream terminated before required bytes were read.
Failed at 'Open a solution with environment service' (5573ms) with error: Error: Stream terminated before required bytes were read.
.NET server exited with null
Failed at 'Open a solution' (5581ms) with error: SolutionOpenError: Run into errors while opening the solution: Error: Stream terminated before required bytes were read.
Failed to open solution SolutionOpenError: Run into errors while opening the solution: Error: Stream terminated before required bytes were read.

macOS M1, Ventura 13.6 dotnet 8.0.100 VS Code Version: 1.84.2 (Universal) devkit: v1.0.14

Deadvi5 commented 9 months ago

Same here

zhoudi94 commented 8 months ago

I have the same problem

Extension Host output image

c# devkit output image

macOS M2,Sonoma 14.3.1 dotnet 7.0.404 vscode:1.86 devkit:1.3.10

github-actions[bot] commented 7 months ago

This issue has been marked as stale after 14 days of inactivity. @[ @ @], could you please take a look?

gonzalorf commented 6 months ago

Any news about this? I'm having the same problem.

andysleigh commented 6 months ago

Same here

vscode 1.88.1, M1 Mac 14.4.1, dotnet 8.0.201

georg138 commented 4 months ago

I had the same issue. After installing the current version of .NET 6 (6.0.31) to get GitExtensions working, it works. Before, I already had 6.0.30 installed (alongside with .NET 8.0.6 and others)

mumiman commented 1 month ago

I try bwulms 's solution [https://github.com/microsoft/vscode-dotnettools/issues/1157] and it's work. "Solved by removing dotnet completely by deleting /usr/local/share/dotnet and then installing only the arm version of the dotnet 8 sdk."

NogginBops commented 1 month ago

I'm also having the same issue. I tried reinstalling dotnet (I only have 8.0 installed now). This is an intel mac. Here is the log I'm getting:

Starting Spawn .NET server...
Starting opening a solution...
Starting processing the solution file "/Users/juliushager/Documents/GitHub/opentk/OpenTK.sln" in Dev Kit server...
Using preinstalled .NET runtime at "/usr/local/share/dotnet/dotnet" to load Dev Kit processes.
Found installed dotnet location "/usr/local/share/dotnet/dotnet" to load projects.
IdeBenefitsSource: Failed to fetch entitlements. Error: 'Error: Request to https://api.subscriptions.visualstudio.microsoft.com/Me/Entitlements/IDEBenefits?api-version=2023-03-26&caller=vscode failed with status code: 401 and response ""'
.NET server STDERR: Unhandled exception. 
.NET server STDERR: System.IO.IOException: The system cannot open the device or file specified. : '1816295370-ServiceHubControllerSingleInstanceMutex'
   at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, Boolean& createdNew)
   at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
   at Microsoft.ServiceHub.Controller.Controller.MainAsync(String pipeName, String[] args, String serializedTelemetrySession, Nullable`1 controllerCooldownTimeout)
   at Microsoft.ServiceHub.Controller.Program.Main(String[] args)

.NET server STDERR: [createdump] 
.NET server STDERR: Invalid process id: task_for_pid(43122) FAILED (os/kern) failure (5)
[createdump] This failure may be because createdump or the application is not properly signed and entitled.
[createdump] Failure took 0ms

.NET server STDOUT: [createdump] Target process is alive

.NET server STDERR: Unhandled exception. 
.NET server STDERR: Microsoft.ServiceHub.Client.ControllerConnectionException: Controller terminated before accepting connections. Exit code: 134.
   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)

.NET server STDERR: [createdump] Invalid process id: task_for_pid(43115) FAILED (os/kern) failure (5)
[createdump] This failure may be because createdump or the application is not properly signed and entitled.
[createdump] Failure took 0ms

.NET server STDOUT: [createdump] Target process is alive

Error occurred in launchDotNetServer: Error: Stream terminated before required bytes were read.
Failed at 'Spawn .NET server' (7918ms) with error: Error: Stream terminated before required bytes were read.
Failed at 'processing the solution file "/Users/juliushager/Documents/GitHub/opentk/OpenTK.sln" in Dev Kit server' (7783ms) with error: Error: Stream terminated before required bytes were read.
Failed at 'opening a solution' (7788ms) with error: SolutionOpenError: Run into errors while opening the solution: Error: Stream terminated before required bytes were read.
Failed to open solution '/Users/juliushager/Documents/GitHub/opentk/OpenTK.sln': SolutionOpenError: Run into errors while opening the solution: Error: Stream terminated before required bytes were read.
.NET server exited with null
Starting opening a solution...
Starting processing the solution file "/Users/juliushager/Documents/GitHub/opentk/OpenTK.sln" in Dev Kit server...
Failed at 'processing the solution file "/Users/juliushager/Documents/GitHub/opentk/OpenTK.sln" in Dev Kit server' (0ms) with error: Error: Stream terminated before required bytes were read.
Failed at 'opening a solution' (3ms) with error: SolutionOpenError: Run into errors while opening the solution: Error: Stream terminated before required bytes were read.
Failed to open solution SolutionOpenError: Run into errors while opening the solution: Error: Stream terminated before required bytes were read.

There are two users on the system and the logged-in user is not the "main" user of the system.

The .sln file used can be found here: https://github.com/NogginBops/opentk/blob/4d8ecc296f07b3ce47199a852369e92a1f036adf/OpenTK.sln This solution works fine in Visual Studio on windows and using the C# dev kit on linux.

I only got this issue recently and the C# dev kit has historically been working decently until today.

NogginBops commented 1 month ago

Restarting the computer fixed my issue, at least for now.

Michael-Eng commented 3 weeks ago

Since most of the original issues are stale (about .NET6 and we've moved to .NET8) and the most recent comments from @NogginBops has been resolved, I'm going to close this out.

If you're still having issues getting started please log a new issue so we can ask/review your logs.