简体   繁体   English

如何一次性或手动或本地安装 C# 依赖项以在没有 Internet 连接的 VS-code 的情况下离线工作?

[英]How to install C# dependencies one time or manually or locally to work offline without internet connection for VS-code?

I don't need to download the packages of C# dependencies every time I reopen my project it's consume the time.每次我重新打开我的项目时,我都不需要下载 C# 依赖项的包,这会消耗时间。 Also, when you have a slow internet connection like my case will be difficult to going on.此外,当您的互联网连接速度较慢时,我的情况将很难进行。

what I get when searching about solution is.vsix solution but it did't help.我在搜索解决方案时得到的是.vsix 解决方案,但它没有帮助。

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

Downloading package 'OmniSharp for Windows (.NET 4.6 / x64)' (33778 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package 'OmniSharp for Windows (.NET 4.6 / x64)'

Downloading package '.NET Core Debugger (Windows / x64)' (47489 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package '.NET Core Debugger (Windows / x64)'

Downloading package 'Razor Language Server (Windows / x64)' (59571 KB).................... Done!
Installing package 'Razor Language Server (Windows / x64)'

Finished

Screenshot of downloading package after opening the project打开工程后下载package截图

What I need is to open asp.net core 2.2 projects without re-downloading packages of C# dependencies.我需要的是打开 asp.net 核心 2.2 项目,而无需重新下载 C# 依赖项的包。

As Lex Li mentions in a comment:正如Lex Li 在评论中提到的:

I said that because I have an extension that does the same (same code from Omnisharp).我这么说是因为我有一个可以做同样事情的扩展(来自 Omnisharp 的相同代码)。 Ever since VSCode started to auto update extensions, you as an end user might never realize how often an extension has been updated, and each update will trigger a full download of the dependencies (how VSCode works).自从 VSCode 开始自动更新扩展后,作为最终用户的您可能永远不会意识到扩展的更新频率,并且每次更新都会触发完全下载依赖项(VSCode 的工作原理)。 So your personal feeling/understanding is far from the truth.因此,您的个人感觉/理解与事实相去甚远。 Like I said, if you disable auto update, then those dependencies will be well cached, and you can update the extension while you have a good connection to download those dependencies again.就像我说的,如果您禁用自动更新,那么这些依赖项将被很好地缓存,并且您可以在连接良好时更新扩展程序以再次下载这些依赖项。

I have disabled VSCode auto update of the extensions to avoid it downloading the bits automatically and it's working well.我已经禁用了扩展的 VSCode 自动更新,以避免它自动下载这些位并且它运行良好。

The Omnisharp repository has the document here . Omnisharp 存储库在此处有文档。 You could pack the platform-specific Omnisharp dependencies to a vsix package, and install it on the target computer offline.您可以将特定于平台的 Omnisharp 依赖项打包到 vsix package,然后离线安装在目标计算机上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM