Go to Definition not working
See original GitHub issueEnvironment data
dotnet --info
output:
.NET Command Line Tools (1.0.3) Product Information: Version: 1.0.3 Commit SHA-1 hash: 37224c9917 Runtime Environment: OS Name: Windows OS Version: 6.1.7601 OS Platform: Windows RID: win7-x64 Base Path: C:\Program Files\dotnet\sdk\1.0.3
VS Code version: 1.11.2 C# Extension version: 1.9.0
Steps to reproduce
- visual studio code open a folder that containstodoApi.csproj and some *.cs files
- open a .cs file and right click a class, “got to definition” appeared, but it does not work. and wait a minute “go to definition” disappered.
Expected behavior
“go to definition” work well
Actual behavior
“go to definition” does not work
omnisharp log:
Starting OmniSharp server at 2017/5/3 上午11:37:28 Target: e:\Visual Studio Code\DotNetCore\todoApi OmniSharp server started Path: C:\Users\user.vscode\extensions\ms-vscode.csharp-1.9.0\bin\omnisharp\OmniSharp.exe PID: 8820 [ERROR] Error: OmniSharp server load timed out. Use the ‘omnisharp.projectLoadTimeout’ setting to override the default delay (one minute).
Visual Studio 2010 Installed
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (5 by maintainers)
Top GitHub Comments
Just in case it helps anyone… There may be multiple “projects” in the folder and VSCode has selected the “wrong” one.
Use ctrl-shift-P and select “OmniSharp: Select Project” to select the correct project (a .sln file).
If you have the Output window open with “OmniSharp Logs” selected, you will see it reading your csproj’s. Once finished your goto definition will start to work
I had the same issue; I looked at the OmniSharp logs and found
For me the problem was that OmniSharp was trying to execute \OmniSharp.dll If you go to settings Omnisharp:path and put the full path to OmniSharp.exe it works. In your example @spy653 it would be : C:\Users\Richa.vscode\extensions\ms-dotnettools.csharp-1.25.0-win32-x64.omnisharp\1.39.0-net6.0\OmniSharp.exe YMMV but hope it helps someone!