[Solved] Docker Start Error: System.InvalidOperationException Failed to set version to docker-desktop exit code

Project scenario:

Docker 3.2.2
win10 Home Edition

Problem Description:

The docker opens error: System.InvalidOperationException: Failed to set version to docker-desktop: exit code: -1
detailed error report:

System.InvalidOperationException:
Failed to set version to docker-desktop: exit code: -1
 stdout: ?S??v?[a?{|?W
N/ec??v?dO0
stderr: 
   在 Docker.ApiServices.WSL2.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) 位置 C:workspacesPR-15387srcgithub.comdockerpinatawinsrcDocker.ApiServicesWSL2WslCommand.cs:Line 146
   在 Docker.Engines.WSL2.WSL2Provisioning.<ProvisionAsync>d__8.MoveNext() 位置 C:workspacesPR-15387srcgithub.comdockerpinatawinsrcDocker.DesktopEnginesWSL2WSL2Provisioning.cs:Line 82
--- The end of the stack trace in the previous location where the exception was raised ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__26.MoveNext() 位置 C:workspacesPR-15387srcgithub.comdockerpinatawinsrcDocker.DesktopEnginesWSL2LinuxWSL2Engine.cs:Line 104
--- The end of the stack trace in the previous location where the exception was raised ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 Docker.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext() 位置 C:workspacesPR-15387srcgithub.comdockerpinatawinsrcDocker.ApiServicesStateMachinesTaskExtensions.cs:Line 29
--- The end of the stack trace in the previous location where the exception was raised ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   在 Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() 位置 C:workspacesPR-15387srcgithub.comdockerpinatawinsrcDocker.ApiServicesStateMachinesStartTransition.cs:Line 67
--- The end of the stack trace in the previous location where the exception was raised ---
   在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   在 Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() 位置 C:workspacesPR-15387srcgithub.comdockerpinatawinsrcDocker.ApiServicesStateMachinesStartTransition.cs:Line 92

Screenshot:

 

Solution:

Execute under cmd/shell

netsh winsock reset

Then restart docker

Read More: