VSCode下载.NET Runtime v7.0.9时出现超时错误。

huangapple go评论88阅读模式
英文:

VSCode timeout error when download dotnet runtime v7.0.9

问题

我的vscode在尝试下载dotnet runtime v7.0.9时遇到超时错误

> 正在下载.NET Runtime。
> 正在下载.NET版本 7.0.9 .......................................................................................................................... 错误!
> 无法下载.NET 7.0.9:
> .NET安装超时。
>
> 错误!
> .NET获取失败:安装失败:错误:.NET安装超时。

而且C#的智能功能不起作用,我的C#输出是

> [错误 - 2:06:46 AM] Microsoft.CodeAnalysis.LanguageServer客户端:无法创建与服务器的连接。
> 错误:无法解析dotnet路径!
> 在t.DotnetRuntimeExtensionResolver.<anonymous> (c:\Users\Jaam-e-Jam.vscode\extensions\ms-dotnettools.csharp-2.0.249-win32-x64\dist\extension.js:2:1009858)处
> 在生成器.next (<anonymous>)处
> 在s (c:\Users\Jaam-e-Jam.vscode\extensions\ms-dotnettools.csharp-2.0.249-win32-x64\dist\extension.js:2:1008463)处

我搜索了一下网络,然后将它设置到setting.json文件中

    "dotnetAcquisitionExtension.existingDotnetPath": [
        {
            "extensionId": "ms-dotnettools.csdevkit",
            "path": "C:\\Program Files\\dotnet\\dotnet.exe"
        },
        {
            "extensionId": "ms-dotnettools.vscodeintellicode-csharp",
            "path": "C:\\Program Files\\dotnet\\dotnet.exe"
        },
        {
            "extensionId": "ms-dotnettools.csharp",
            "path": "C:\\Program Files\\dotnet\\dotnet.exe"
        },
        {
            "extensionId": "ms-dotnettools.vscode-dotnet-runtime",
            "path": "C:\\Program Files\\dotnet\\dotnet.exe"
        }
    ]

但对于每个项目我都必须设置它!我该如何修复这个问题?

英文:

My vscode when want to download dotnet runtime v7.0.9 get error time out

> Downloading the .NET Runtime.
> Downloading .NET version(s) 7.0.9 .......................................................................................................................... Error!
> Failed to download .NET 7.0.9:
> .NET installation timed out.
>
> Error!
> .NET Acquisition Failed: Installation failed: Error: .NET installation timed out.

and intelligence of C# doesnot work and my C# output is

> [Error - 2:06:46 AM] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server.
> Error: Could not resolve the dotnet path!
> at t.DotnetRuntimeExtensionResolver.<anonymous> (c:\Users\Jaam-e-Jam.vscode\extensions\ms-dotnettools.csharp-2.0.249-win32-x64\dist\extension.js:2:1009858)
> at Generator.next (<anonymous>)
> at s (c:\Users\Jaam-e-Jam.vscode\extensions\ms-dotnettools.csharp-2.0.249-win32-x64\dist\extension.js:2:1008463)

I Search the net and I set it to setting.json file

    &quot;dotnetAcquisitionExtension.existingDotnetPath&quot;: [
        {
            &quot;extensionId&quot;: &quot;ms-dotnettools.csdevkit&quot;,
            &quot;path&quot;: &quot;C:\\Program Files\\dotnet\\dotnet.exe&quot;
        },
        {
            &quot;extensionId&quot;: &quot;ms-dotnettools.vscodeintellicode-csharp&quot;,
            &quot;path&quot;: &quot;C:\\Program Files\\dotnet\\dotnet.exe&quot;
        },
        {
            &quot;extensionId&quot;: &quot;ms-dotnettools.csharp&quot;,
            &quot;path&quot;: &quot;C:\\Program Files\\dotnet\\dotnet.exe&quot;
        },
        {
            &quot;extensionId&quot;: &quot;ms-dotnettools.vscode-dotnet-runtime&quot;,
            &quot;path&quot;: &quot;C:\\Program Files\\dotnet\\dotnet.exe&quot;
        }
    ]

but for each project i must to set it!
How can i fix it?

答案1

得分: 2

"dotnetAcquisitionExtension.existingDotnetPath": [
    {
        "extensionId": "ms-dotnettools.csdevkit",
        "path": "C:\\Program Files\\dotnet\\dotnet.exe"
    },
    {
        "extensionId": "ms-dotnettools.vscodeintellicode-csharp",
        "path": "C:\\Program Files\\dotnet\\dotnet.exe"
    },
    {
        "extensionId": "ms-dotnettools.csharp",
        "path": "C:\\Program Files\\dotnet\\dotnet.exe"
    },
    {
        "extensionId": "ms-dotnettools.vscode-dotnet-runtime",
        "path": "C:\\Program Files\\dotnet\\dotnet.exe"
    }
]

以上代码有用,并且是答案,但我们需要将其写入以下地址:

%APPDATA%\Code\User\settings.json

感谢 @LexLi 提供的信息。

英文:
&quot;dotnetAcquisitionExtension.existingDotnetPath&quot;: [
        {
            &quot;extensionId&quot;: &quot;ms-dotnettools.csdevkit&quot;,
            &quot;path&quot;: &quot;C:\\Program Files\\dotnet\\dotnet.exe&quot;
        },
        {
            &quot;extensionId&quot;: &quot;ms-dotnettools.vscodeintellicode-csharp&quot;,
            &quot;path&quot;: &quot;C:\\Program Files\\dotnet\\dotnet.exe&quot;
        },
        {
            &quot;extensionId&quot;: &quot;ms-dotnettools.csharp&quot;,
            &quot;path&quot;: &quot;C:\\Program Files\\dotnet\\dotnet.exe&quot;
        },
        {
            &quot;extensionId&quot;: &quot;ms-dotnettools.vscode-dotnet-runtime&quot;,
            &quot;path&quot;: &quot;C:\\Program Files\\dotnet\\dotnet.exe&quot;
        }
    ]

Above code is usefull and is answer but we need write it in this Address

%APPDATA%\Code\User\settings.json

Thanks a lot from @LexLi

huangapple
  • 本文由 发表于 2023年7月17日 17:40:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/76703190.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定