Omnisharp not reloading references
See original GitHub issueIssue Description
Every time I reference a new class and get the quick fixes I don’t get the option to add a “using namespace” statement to the file.
Also when I reference a new class contained in a namespace that is already referenced I still get the error:
The type or namespace name 'ClassName' could not be found (are you missing a using directive or an assembly reference?)
To fix it I have to manually restart Omnisharp
Some more context: I’m running VSCode on Docker containers
Steps to Reproduce
- Create a simple dotnet core application
- Create 2 class files in separate namespaces and reference one in the other
Expected Behavior
You should be able to get the option to add a Using statement when using the Quick Fix feature
Actual Behavior
Quick Fix feature not shown, unless Omnisharp is restarted
Logs
OmniSharp log
Starting OmniSharp server at 11/3/2020, 2:10:59 PM
Target: /workspace
OmniSharp server started.
Path: /root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.4/.omnisharp/1.37.3/run
PID: 1532
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on debian 10.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.8.0 - "/root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.4/.omnisharp/1.37.3/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.4/.omnisharp/1.37.3/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.8.0 - "/root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.4/.omnisharp/1.37.3/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.4/.omnisharp/1.37.3/omnisharp/.msbuild/Current/Bin
CscToolPath = /root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.4/.omnisharp/1.37.3/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /root/.vscode-server/extensions/ms-dotnettools.csharp-1.23.4/.omnisharp/1.37.3/omnisharp/.msbuild
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/workspace'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/workspace'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/workspace/ContentEditor.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/workspace'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /workspace/ContentEditor.csproj
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/workspace' on host 371.
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/workspace/ContentEditor.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/workspace/ContentEditor.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Update project: ContentEditor
C# log
Installing C# dependencies...
Platform: linux, x86_64, name=debian, version=10
Downloading package 'OmniSharp for Linux (x64)' (47313 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package 'OmniSharp for Linux (x64)'
Downloading package '.NET Core Debugger (linux / x64)' (55714 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package '.NET Core Debugger (linux / x64)'
Downloading package 'Razor Language Server (Linux / x64)' (54208 KB).................... Done!
Installing package 'Razor Language Server (Linux / x64)'
Finished
Environment information
VSCode version: 1.50.1 C# Extension: 1.23.4
Mono Information
OmniSharp using built-in monoDotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.1.403 Commit: 9e895200cdRuntime Environment: OS Name: debian OS Version: 10 OS Platform: Linux RID: debian.10-x64 Base Path: /usr/share/dotnet/sdk/3.1.403/
Host (useful for support): Version: 3.1.9 Commit: 774fc3d6a9
.NET Core SDKs installed: 3.1.403 [/usr/share/dotnet/sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
csharp | ms-dotnettools | 1.23.4 |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:18 (2 by maintainers)
Top GitHub Comments
A fix is available in this pre-release build - https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.23.6-beta1. Instructions for installing our beta releases https://github.com/OmniSharp/omnisharp-vscode/wiki/Installing-Beta-Releases
New issue filed: see https://github.com/OmniSharp/omnisharp-vscode/issues/4223