VS Code使用本地OmniSharp安装C#扩展

时间:2018-03-29 10:41:41

标签: visual-studio-code omnisharp

由于我当前工作设置的限制,我正在尝试本地安装VS Code C#扩展。我可以使用市场或.vsix安装它,但遇到试图安装所需的OmniSharp工具集的问题。

因此我安装了OmniSharp的本地版本,并在VS Code中设置了omnisharp.path设置以指向此本地安装。我的问题是,扩展程序仍然会尝试下载OmniSharp的版本而不是使用它。

有没有办法解决这个问题,而无需设置VS Code以便与我们的网络很好地协作(可能是代理问题)?

<小时/> 扩展管理器输出以供参考:

Updating C# dependencies...
Platform: win32, x86_64

Downloading package 'OmniSharp for Windows (.NET 4.6 / x64)'    Retrying from 'https://omnisharpdownload.blob.core.windows.net/ext/omnisharp-win-x64-1.23.2.zip' Downloading package '.NET Core Debugger (Windows / x64)'   Retrying from 'https://vsdebugger.blob.core.windows.net/coreclr-debug-1-12-5/coreclr-debug-win7-x64.zip' 
Installing package 'OmniSharp for Windows (.NET 4.6 / x64)'
Failed at stage: installPackages
Error: end of central directory record signature not found

Finished

1 个答案:

答案 0 :(得分:2)

我认为这是由于公司代理设置的限制。您可以从此处按照解决方法进行操作 - &gt; https://www.codeproject.com/Tips/1209935/VS-Code-NET-Core-Offline-installation-of-extension

这对我有用。但我已将路径更改为%USERPROFILE%.vscode\extensions\ms-vscode.csharp-1.14.0\.omnisharp以使其正常工作。

相关问题