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

VSCode not working (probably a dup of #1260) #1265

Closed
glmnet opened this issue May 21, 2024 · 2 comments
Closed

VSCode not working (probably a dup of #1260) #1265

glmnet opened this issue May 21, 2024 · 2 comments

Comments

@glmnet
Copy link
Contributor

glmnet commented May 21, 2024

Environments

  • IDE Version: vscode 1.89.1
  • Extension Version: 1.7.2
  • CSharpier Version: 0.28.2
    will NOT be the same as the extension version
  • Operating System: w11
  • .csharpierrc Settings: no
  • .editorconfig Settings: no

Log Output

["INFO" - 8:15:39 PM] Initializing csharpier-vscode
["DEBUG" - 8:15:39 PM] Trying to find dotnet on PATH using 'dotnet --info' 
["DEBUG" - 8:15:42 PM] Using dotnet found from PATH at C:\Program Files\dotnet\dotnet.exe
["DEBUG" - 8:15:43 PM] c:\Users\glmne\.vscode\extensions\csharpier.csharpier-vscode-1.7.2\build
["DEBUG" - 8:15:43 PM] c:\Users\glmne\.vscode\extensions\csharpier.csharpier-vscode-1.7.2\build
["DEBUG" - 8:15:43 PM] Ensure there is a csharpier process for c:\git\dfp1\src\DF.DFp1
["DEBUG" - 8:15:43 PM] Looking for c:\git\dfp1\src\DF.DFp1/*.csproj
["DEBUG" - 8:15:43 PM] Looking at c:\git\dfp1\src\DF.DFp1\DF.DFp1.csproj
["DEBUG" - 8:15:43 PM] Looking for c:\git\dfp1\src\DF.DFp1\.config\dotnet-tools.json
["DEBUG" - 8:15:43 PM] Looking for c:\git\dfp1\src/*.csproj
["DEBUG" - 8:15:43 PM] Looking for c:\git\dfp1\src\.config\dotnet-tools.json
["DEBUG" - 8:15:43 PM] Looking for c:\git\dfp1/*.csproj
["DEBUG" - 8:15:43 PM] Looking for c:\git\dfp1\.config\dotnet-tools.json
["DEBUG" - 8:15:43 PM] Looking for c:\git/*.csproj
["DEBUG" - 8:15:43 PM] Looking for c:\git\.config\dotnet-tools.json
["DEBUG" - 8:15:43 PM] Looking for c:\/*.csproj
["DEBUG" - 8:15:43 PM] Looking for c:\.config\dotnet-tools.json
["DEBUG" - 8:15:43 PM] Unable to find dotnet-tools.json, falling back to running dotnet csharpier --version
["DEBUG" - 8:15:44 PM] dotnet csharpier --version output: 0.28.2
["DEBUG" - 8:15:44 PM] Using 0.28.2 as the version number.
["DEBUG" - 8:15:44 PM] Validating install at C:\Users\glmne\AppData\Local\CSharpier\0.28.2
["DEBUG" - 8:15:45 PM] "C:\Users\glmne\AppData\Local\CSharpier\0.28.2\dotnet-csharpier" --version output: 0.28.2
["DEBUG" - 8:15:45 PM] Using 0.28.2 as the version number.
["DEBUG" - 8:15:45 PM] CSharpier at C:\Users\glmne\AppData\Local\CSharpier\0.28.2 already exists
["DEBUG" - 8:15:45 PM] Adding new version 0.28.2 process for c:\git\dfp1\src\DF.DFp1
["DEBUG" - 8:15:45 PM] Warm CSharpier with initial format
["INFO" - 8:15:45 PM] Formatting started for c:\git\dfp1\src\DF.DFp1\UnreliableChannel.cs using CSharpier 0.28.2
["DEBUG" - 8:15:45 PM] Connecting via port 49152
["WARN" - 8:15:45 PM] CSharpier process return the following error: 
"Unhandled exception: "
["WARN" - 8:15:45 PM] CSharpier process return the following error: 
"System.Net.Sockets.SocketException (10013): An attempt was made to access a socket in a way forbidden by its access permissions.
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportOptions.CreateDefaultBoundListenSocket(EndPoint endpoint)
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.Bind()
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportFactory.BindAsync(EndPoint endpoint, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.TransportManager.BindAsync(EndPoint endPoint, ConnectionDelegate connectionDelegate, EndpointConfig endpointConfig, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.<>c__DisplayClass28_0`1.<<StartAsync>g__OnBind|0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.BindAsync(AddressBindContext context, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.EndpointsStrategy.BindAsync(AddressBindContext context, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(ListenOptions[] listenOptions, AddressBindContext context, Func`2 useHttps, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
   at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at CSharpier.Cli.Server.ServerFormatter.StartServer(Nullable`1 port, ConsoleLogger logger, String actualConfigPath, CancellationToken cancellationToken) in /home/runner/work/csharpier/csharpier/Src/CSharpier.Cli/Server/ServerFormatter.cs:line 36
   at CSharpier.Cli.Program.Run(String[] directoryOrFile, Boolean check, Boolean fast, Boolean skipWrite, Boolean writeStdout, Boolean pipeMultipleFiles, Boolean server, Nullable`1 serverPort, Boolean noCache, Boolean noMSBuildCheck, Boolean includeGenerated, String configPath, LogLevel logLevel, CancellationToken cancellationToken) in /home/runner/work/csharpier/csharpier/Src/CSharpier.Cli/Program.cs:line 59
   at System.CommandLine.Invocation.CommandHandler.GetExitCodeAsync(Object value, InvocationContext context)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.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__DisplayClass23_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass27_0.<<UseVersionOption>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__24_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseDebugDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()
"
["WARN" - 8:15:46 PM] CSharpier process failed to start. Formatting cannot occur.
["WARN" - 8:15:46 PM] CSharpier process failed to start. Formatting cannot occur.
["WARN" - 8:15:46 PM] CSharpier process failed to start. Formatting cannot occur.
["INFO" - 8:15:46 PM] Formatted in 1004.4106000065804ms
["DEBUG" - 8:15:48 PM] c:\Users\glmne\.vscode\extensions\csharpier.csharpier-vscode-1.7.2\build
["DEBUG" - 8:15:48 PM] Ensure there is a csharpier process for c:\git\dfp1\src\DF.DFp1
["DEBUG" - 8:15:51 PM] c:\Users\glmne\.vscode\extensions\csharpier.csharpier-vscode-1.7.2\build
["INFO" - 8:15:51 PM] Formatting started for c:\git\dfp1\src\DF.DFp1\UnreliableChannel.cs using CSharpier 0.28.2
["WARN" - 8:15:51 PM] CSharpier process failed to start. Formatting cannot occur.
["INFO" - 8:15:51 PM] Formatted in 0.3797000050544739ms
["DEBUG" - 8:17:50 PM] c:\Users\glmne\.vscode\extensions\csharpier.csharpier-vscode-1.7.2\build
["DEBUG" - 8:17:50 PM] Ensure there is a csharpier process for c:\git\dfp1\src\DF.DFp1

Steps to reproduce
format on save

Expected behavior

Actual behavior

@glmnet
Copy link
Contributor Author

glmnet commented May 21, 2024

Restarting the computer fixed the problem. (Previous try restarting vscode did not work)

Not sure the issue, did check the port it chose was open by something else but that didn't seem to be the cause.

@glmnet glmnet closed this as completed May 21, 2024
@belav
Copy link
Owner

belav commented May 31, 2024

My guess is that you ran into the windows reserving ports issue - #1249 (comment)

I'll have a better fix out in 0.29 and will update the extensions to stop using csharpier server on 0.28 to avoid you running into this again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants