dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.85k stars 670 forks source link

Offline mode don't work #3643

Open delgelato opened 4 years ago

delgelato commented 4 years ago

Hi, i'm trying to make the extension to work when offline, but it'll be stuck on .. Error occurred in loading omnisharp from omnisharp.path Could not start the server due to Error: Request error: getaddrinfo ENOTFOUND roslynomnisharp.blob.core.windows.net roslynomnisharp.blob.core.windows.net:443

The omnisharp.path was by default set to "latest"

I tried this https://www.towfeek.se/2017/07/05/enabling-csharp-and-dotnet-core-debugging-in-vs-code-from-an-offline-environment/ But after completing it, it's actually to install the extension when there's no internet. I already have the extension, so this is not the correct solution

Also tried changing omnisharp.path in settings to:

-"C:\Users\Owner\.vscode\extensions\ms-vscode.csharp-1.21.11\.omnisharp\1.34.13\OmniSharp.exe" Result: Many logs, among others: OmniSharp server started. Path: C:\Users\Owner.vscode\extensions\ms-vscode.csharp-1.21.11.omnisharp\1.34.13\OmniSharp.exe PID: 12356

    Adding project 'd:\Projects\Testing Mario\Testing Mario\Assembly-CSharp-firstpass.csproj'
    Loading project: d:\Projects\Testing Mario\Testing Mario\Assembly-CSharp.csproj
    Successfully loaded project file 'd:\Projects\Testing Mario\Testing Mario\Assembly-CSharp.csproj'.
    Update project: Assembly-CSharp
    Unable to resolve assembly 'd:\Projects\Testing Mario\Testing Mario\Temp\bin\Debug\Assembly-CSharp-firstpass.dll'

-nothing (deleted the entry): Result: Same as above

So, is this even possible? Or does the extension absolutely needs internet?

Cheers

JoeRobich commented 4 years ago

@delgelato That post is a bit old. We have an entry in our wiki for building offline packages - https://github.com/OmniSharp/omnisharp-vscode/wiki/Installing-the-C%23-extension-to-a-computer-without-internet-connectivity. Let me know if you run into any problems.

WellspringCS commented 4 years ago

FWIW, I'm here because my laptop (Linux on an XPS 15, internet always a wee bit brittle with Ubuntu) dropped internet on a reboot. Got the internet worked out by unplugging and replugging the dongle, but what I found more than a little distressing was this same message from VSCode: "Error occurred in loading omnisharp from omnisharp.path" same as reported here.

VSCode was high and dry with nothing functioning. Wait... the internet goes out and suddenly I cannot develop offline?

So.... that was weird.

Once the internet came back, so did Omnisharp.

MicahZoltu commented 3 years ago

I have been using OmniSharp without problems on my computer. Today the power went out which resulted in my internet connection dying for a few minutes. During that time I launched VSCode, opened a C# project, and then saw this in the OmniSharp Log:

Error occurred in loading omnisharp from omnisharp.path
Could not start the server due to Error: Request error: getaddrinfo ENOTFOUND roslynomnisharp.blob.core.windows.net

The wiki claims that this shouldn't be the case: https://github.com/OmniSharp/omnisharp-vscode/wiki/Installing-the-C%23-extension-to-a-computer-without-internet-connectivity#installing-on-an-occasionally-connected-computer

make sure you have internet connectivity the first time you use the C# extension. After that you can be offline forever.

However, this was not what experienced. I expected to be able to open up OmniSharp without an internet connection given it was working not 2 minutes prior on the exact same project.

filipw commented 3 years ago

it sounds like you must have "omnisharp.path": "latest" set. it downloads every new pre-release automatically. you can remove it to stick to Omnisharp bundled with the extension

MicahZoltu commented 3 years ago

It feels like latest should fallback to "latest downloaded version" when internet is out, rather than hard failing. Maybe give a warning about being unable to download.

lixaotec commented 3 years ago

+1 .. it would be nice to work totally offline

neeeeecka commented 3 years ago

15 July 2021, still the same issue. Working offline is impossible

rohitramu commented 2 years ago

22nd of December 2021, still same issue here.

MostHated commented 2 years ago

Same issue here. I am constantly connected to VPN for work, which doesn't have connection to outside internet, so I just get "!!MISSING command!!" and whatnot, but as soon as I disconnect, everything starts working. Our MFA policy makes it extremely unpractical to even consider disconnecting and reconnecting throughout the day to try and get assistance from omnisharp.