引言
啟動報錯提示為:“The attempted operation is not supported for the type of object referenced”,即“參考的物件型別不支持嘗試的操作”,作業系統為中文的用戶提示還可能為亂碼,看也看不懂,這邊也貼出來作為搜索關鍵詞:?S ??v?[a?{|?W N/e c \??v?d\O 0 ,這個錯誤發生在版本比較新的docker-desktop中,使用WSL2作為基本引擎,
System.InvalidOperationException:
Failed to set version to docker-desktop: exit code: -1
stdout: The attempted operation is not supported for the type of object referenced.
stderr:
at Docker.ApiServices.WSL2.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\PR-18120\src\github.com\docker\pinata\win\src\Docker.ApiServices\WSL2\WslCommand.cs:line 160
at Docker.Engines.WSL2.WSL2Provisioning.<ProvisionAsync>d__8.MoveNext() in C:\workspaces\PR-18120\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\WSL2Provisioning.cs:line 81
正文
查閱資料時發現有很多人遇到,問題的原因解釋為一個LSP DLL在WSL中加載呼叫失敗引起的,解決辦法很簡單,只要防止WSL去加載這個LSP就可以了,
附上部分問題參考:
[SOLUTION] "The attempted operation is not supported for the type of object referenced." error after Windows Update #547 - MicrosoftDocs / WSL
win docker【?S ??v?[a?{|?W N/e c \??v?d\O 0】報錯誤 - User_undefined
WSL2啟動時提示:參考的物件型別不支持嘗試的操作 - fangye945a
本人也通過執行netsh winsock reset 重置winsock來臨時解決這個問題,這個治標不治本,電腦重啟后該報錯還是得報錯,
最終簡單方便不易出錯的方法就是下面這個了:
把下面的陳述句保存為注冊表注冊檔案wsl.reg ,保存后執行把配置插入到注冊表,成功注冊后重啟docker-desktop就可以了,
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\AppId_Catalog\0408F7A3]
"AppFullPath"="C:\\Windows\\System32\\wsl.exe"
"PermittedLspCategories"=dword:80000000
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/491589.html
標籤:Windows
