VS Code 使用本地 OmniSharp 安装 C# 扩展 [英] VS Code install C# extension with local OmniSharp

查看:21
本文介绍了VS Code 使用本地 OmniSharp 安装 C# 扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Due to limitations with my current work setup, I'm trying to do a local installation of the VS Code C# extension. I can install it fine using the marketplace or a .vsix, but run into issues where it tries to install the required OmniSharp toolset.

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

As a result of this I have installed a local version of OmniSharp and have set the omnisharp.path setting in VS Code to point at this local installation. My issue is that instead of using this, the extension will still try and download a version of OmniSharp.

有没有办法解决这个问题,而不必设置 VS Code 来与我们的网络很好地协同工作(可能是代理问题)?<小时>扩展管理器输出供参考:

Is there a way of working around this, without having to set up VS Code to work nicely with our network (probably proxy issues)?


Extension manager output for reference:

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

推荐答案

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

I believe this is due to restriction from corporate proxy setup. You can follow the workaround from here --> https://www.codeproject.com/Tips/1209935/VS-Code-NET-Core-Offline-installation-of-extension

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

It is working for me. But I have changed the path to %USERPROFILE%.vscode\extensions\ms-vscode.csharp-1.14.0\.omnisharp to make it work.

这篇关于VS Code 使用本地 OmniSharp 安装 C# 扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆