dotnet / vscode-csharp

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

C# Debug and IntelliSense not working on a Linux environment - Stuck on Downloading package 'Razor Language Server Telemetry' #6547

Closed coderade closed 10 months ago

coderade commented 11 months ago

Environment data

dotnet --info output:

.NET SDK:
Version:   7.0.306
Commit:    f500069cb7

Runtime Environment:
OS Name:     amzn
OS Version:  2
OS Platform: Linux
RID:         linux-x64
Base Path:   /home/valgsfi/.dotnet/sdk/7.0.306/

Host:
  Version:      7.0.9
  Architecture: x64
  Commit:       8e9a17b221

.NET SDKs installed:
  3.0.103 [/home/valgsfi/.dotnet/sdk]
  3.1.426 [/home/valgsfi/.dotnet/sdk]
  6.0.408 [/home/valgsfi/.dotnet/sdk]
  7.0.306 [/home/valgsfi/.dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.0.3 [/home/valgsfi/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.32 [/home/valgsfi/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.16 [/home/valgsfi/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.9 [/home/valgsfi/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.0.3 [/home/valgsfi/.dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.32 [/home/valgsfi/.dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.16 [/home/valgsfi/.dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.9 [/home/valgsfi/.dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/home/valgsfi/.dotnet]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

VS Code version:

Version: 1.83.1
Commit: f1b07bd25dfad64b0167beb15359ae573aecd2cc
Date: 2023-10-10T23:45:31.402Z
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 5.15.133-86.144.amzn2.x86_64

C# Extension version: v2.6.24

OmniSharp log

Installing Razor Telemetry Version = undefined...
Platform: linux, x86_64, name=amzn, version=2

Downloading package 'Razor Language Server Telemetry (Linux / x64)' 

Steps to reproduce

  1. Open a .cs file or try to run a .Net / C# project
  2. Intelissense is not working, I can not go to any implementation or have any help from the IDE
  3. When I try to Run/Debug a C# project, the vscode keeps loading but I do not see any results.

Screenshot 2023-10-16 at 11 42 59

Additional context

Even if try to change the ominsharp logs level I can not see anything more than the message: Downloading package 'Razor Language Server...

dibarbet commented 11 months ago

@davidwengier mind taking a first look here?

davidwengier commented 11 months ago

@coderade Thanks for reporting the issue. Sorry to ask the obvious question, but is there network activity happening while it's supposedly downloading? Do you get issues if you manually try to download the package? The url should be: https://download.visualstudio.microsoft.com/download/pr/baaea3c9-bcff-4331-9fd2-fee91ddbfccb/b4f2fb72ed2acda7263fc597fbd20882/devkittelemetry-linux-x64-7.0.0-preview.23475.5.zip

coderade commented 11 months ago

hi @davidwengier, thanks for the reply. I am able to download the package manually. Maybe I am having a issue with the proxy or other things in the VsCode settings.

Do you know how I can reference this package manually? I will check the network settings on the vscode too.

Thanks,

thompson937 commented 11 months ago

I'm only here to confirm this issue, switching the "C#" extension to version 2.0.320 allows for continued operation.

davidwengier commented 11 months ago

@thompson937 are you also on linux? or a different OS?

@coderade a workaround would be to install it manually I guess. If you can find the VS Code extensions folder, under your user path somewhere, there should be a ms-dotnettools.csharp-<version> folder. If you extract the zip you downloaded into a .razortelemetry folder inside there, hopefully you'll be unblocked while we investigate. Do let us know if that works.

thompson937 commented 11 months ago

@davidwengier Yes, I am using Fedora 38.

davidwengier commented 11 months ago

@thompson937 and you can download the zip file I linked above manually? No proxy settings in VS Code? @coderade did you and up finding anything interesting in the networking settings in VS Code?

I set up a quick test on my machine (in WSL) and everything worked first time, so sadly its nothing obvious like us forgetting that slashes go two ways. I also went through the git history of the download code, and it hasn't meaningfully changed in almost 2 years, and is basically the same as when it was in O#.

I don't have a lot of experience with linux in geneal (read: basically none) so I'm asking around internally, but if there is any extra info either of you can provide that would be helpful, I'm all ears. Do you have network monitors tools installed that could indicate if the download even starts, for example?

coderade commented 11 months ago

@davidwengier thanks for the workaround, looks like after some changes on the vscode network/proxy settings, I am able to download the failing package again, and everything is working properly.

Unfortunately, I am not being to reproduce the error again to check what I actually changed to make this works, and as I am working in a client managed network, maybe they changed something on their proxy side also.

The only issue I see is why we got stuck with this kind of message: Downloading package 'Razor Language Server... and we did not get any error message/log after some minutes, but anyway, right now it is working properly and I can provide other informations if you need.

thanks,

davidwengier commented 10 months ago

Thanks @coderade, glad you got things working. We'll definitely look into adding better error reporting, or a timeout, or something for this.

joshwright10 commented 10 months ago

Also experiencing this on Windows x64. I tried downloading https://download.visualstudio.microsoft.com/download/pr/baaea3c9-bcff-4331-9fd2-fee91ddbfccb/187a09b50228410a03d7e264181e2503/devkittelemetry-win-x64-7.0.0-preview.23475.5.zip and copying it to %USERPROFILE%\.vscode\extensions\ms-dotnettools.csharp-2.8.23-win32-x64\.razortelemetry

However I still see

Installing Razor Telemetry Version = 7.0.0-preview.23475.5... Platform: win32, x86_64

Downloading package 'Razor Language Server Telemetry (Windows / x64)'

davidwengier commented 10 months ago

@joshwright10 Do you have any proxy settings in VS Code set? Anything interesting about your network setup?

Also, as far as the workaround goes, did you extract the zip file and put the contents in the directory? or just put the zip file in that directory?

joshwright10 commented 10 months ago

@davidwengier unfortunately I am behind a corporate proxy ibosscloud I have my Windows PowerShell and PowerShell 7 system profile.ps1 configured with the following:

$proxy="http://cn-randomid.ibosscloud.com:80"
$env:HTTP_PROXY=$proxy
$env:HTTPS_PROXY=$proxy

Relevant VS Code Settings. Proxy server is the same as in the profile.

{
    "http.proxy": "http://cn-randomid.ibosscloud.com:80",
    "http.proxySupport": "on",
    "http.proxyStrictSSL": false
}

I am able to install and uninstall the Extensions from VS Code with no issue. I am also able to access the download link via Edge, so the proxy does allow access.

The zip file was directly extracted into the .vscode\extensions\ms-dotnettools.csharp-2.8.23-win32-x64\.razortelemetry directory. I see language folders and and a bunch of dlls. It looks like it is in the correct location.

I do notice that VS code keeps creating an empty install.Begin file in .vscode\extensions\ms-dotnettools.csharp-2.8.23-win32-x64\.razortelemetry when it starts.

caoqun98 commented 3 months ago

@davidwengier excuse me, but can you tell me how to install the razortelemetry offline? my office computer is offline and it's win10(besides, i also need to install this on another office computer and it's linux, it's also offline) i extracted the zip into the .razortelemetry from the link https://download.visualstudio.microsoft.com/download/pr/baaea3c9-bcff-4331-9fd2-fee91ddbfccb/187a09b50228410a03d7e264181e2503/devkittelemetry-win-x64-7.0.0-preview.23475.5.zip, however, each time i open my vscode, the output still shows downloading package ' razor language server telemetry', and it seems that i cannot debug on my vscode and there is no code navigate or prompts either, do i need to make some other changes?

davidwengier commented 3 months ago

@caoqun98 do the logs indicate what version its trying to download? The link I posted above is pretty old, so if there is a newer version of the package, it will probably still try to download the new one. Also, if you're completely offline you probably want to turn off telemetry in VS Code completely, in which case we'll stop trying to download anything. That change was only recently merged though, in https://github.com/dotnet/vscode-csharp/pull/7092, so it won't have an effect in the version you currently have unfortunately, but soon.

caoqun98 commented 3 months ago

@davidwengier thx for your tips. according to my output and the url in package.json(it's in the csharp installation folder), i downloaded the new one and extracted it in the .razortelemetry, however, it still downloads from the url... do i need to change some other settings in package.json?

davidwengier commented 3 months ago

It looks like after a successful install it puts a 0 byte file on disk called install.Lock, in the .razortelemetry folder. Try creating that file manually perhaps?