You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Certain error types are reported by omnisharp but do not disappear when fixed; a manual restart or build is required to make omnisharp recognize the code is now valid.
I can reproduce with the BOM rule (SA1412) reliably; I've also seen it intermittently with newlines following opening brace (SA1505).
Steps to Reproduce
Open a file with code errors
Fix errors, save file. Omnisharp still shows errors.
F5 to build & debug or or restart omnisharp, and errors will dissapear.
Expected Behavior
Omnisharp removes errors no longer present in codebase
Actual Behavior
Omnisharp hangs on to reported errors until next build
Logs
OmniSharp log
Starting OmniSharp server at 11/5/2020, 9:12:24 AM
Target: /Users/stewartadam/TestTool/ValidationTool.sln
OmniSharp server started.
Path: /Users/stewartadam/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.4-beta.20/run
PID: 28751
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on MacOS 10.15.7 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.8.0 - "/Users/stewartadam/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.4-beta.20/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/Users/stewartadam/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.4-beta.20/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.8.0 - "/Users/stewartadam/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.4-beta.20/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /Users/stewartadam/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.4-beta.20/omnisharp/.msbuild/Current/Bin
CscToolPath = /Users/stewartadam/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.4-beta.20/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /Users/stewartadam/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.4-beta.20/omnisharp/.msbuild
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/stewartadam/TestTool'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
Detecting projects in '/Users/stewartadam/TestTool/ValidationTool.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/stewartadam/TestTool/ConsoleApp/ConsoleApp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/stewartadam/TestTool/ValidatorTool/ValidatorTool.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/stewartadam/TestTool/ValidatorToolTests/ValidatorToolTests.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/Users/stewartadam/TestTool'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/stewartadam/TestTool/ConsoleApp/ConsoleApp.csproj
[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 '/Users/stewartadam/TestTool' on host 25807.
[warn]: OmniSharp.MSBuild.ProjectLoader
Package 'FluentHub 1.0.40' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
[warn]: OmniSharp.MSBuild.ProjectLoader
Package 'FluentHub.Validation 1.0.40' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/stewartadam/TestTool/ConsoleApp/ConsoleApp.csproj'.
/Users/stewartadam/TestTool/ConsoleApp/ConsoleApp.csproj
/Users/stewartadam/TestTool/ConsoleApp/ConsoleApp.csproj(0,0): Error: Package 'FluentHub 1.0.40' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
/Users/stewartadam/TestTool/ConsoleApp/ConsoleApp.csproj(0,0): Error: Package 'FluentHub.Validation 1.0.40' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/Users/stewartadam/TestTool/ConsoleApp/ConsoleApp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/stewartadam/TestTool/ValidatorTool/ValidatorTool.csproj
[warn]: OmniSharp.MSBuild.ProjectLoader
Package 'FluentHub 1.0.40' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
[warn]: OmniSharp.MSBuild.ProjectLoader
Package 'FluentHub.Validation 1.0.40' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/stewartadam/TestTool/ValidatorTool/ValidatorTool.csproj'.
/Users/stewartadam/TestTool/ValidatorTool/ValidatorTool.csproj
/Users/stewartadam/TestTool/ValidatorTool/ValidatorTool.csproj(0,0): Error: Package 'FluentHub 1.0.40' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
/Users/stewartadam/TestTool/ValidatorTool/ValidatorTool.csproj(0,0): Error: Package 'FluentHub.Validation 1.0.40' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/Users/stewartadam/TestTool/ValidatorTool/ValidatorTool.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/stewartadam/TestTool/ValidatorToolTests/ValidatorToolTests.csproj
[warn]: OmniSharp.MSBuild.ProjectLoader
Package 'FluentHub 1.0.40' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
[warn]: OmniSharp.MSBuild.ProjectLoader
Package 'FluentHub.Validation 1.0.40' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/stewartadam/TestTool/ValidatorToolTests/ValidatorToolTests.csproj'.
/Users/stewartadam/TestTool/ValidatorToolTests/ValidatorToolTests.csproj
/Users/stewartadam/TestTool/ValidatorToolTests/ValidatorToolTests.csproj(0,0): Error: Package 'FluentHub 1.0.40' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
/Users/stewartadam/TestTool/ValidatorToolTests/ValidatorToolTests.csproj(0,0): Error: Package 'FluentHub.Validation 1.0.40' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/Users/stewartadam/TestTool/ValidatorToolTests/ValidatorToolTests.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Update project: ConsoleApp
[info]: OmniSharp.MSBuild.ProjectManager
Update project: ValidatorTool
[info]: OmniSharp.MSBuild.ProjectManager
Update project: ValidatorToolTests
[info]: OmniSharp.Roslyn.CSharp.Services.Diagnostics.CSharpDiagnosticWorkerWithAnalyzers
Solution initialized -> queue all documents for code analysis. Initial document count: 29.
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using System.Threading.Tasks;
[info]: OmniSharp.DotNetTest.VSTestManager
read: {"MessageType":"TestSession.Connected","Payload":null}
[info]: OmniSharp.DotNetTest.VSTestManager
read: {"MessageType":"ProtocolVersion","Payload":1}
[info]: OmniSharp.DotNetTest.DebugSessionManager
Debug session started.
[info]: OmniSharp.DotNetTest.DebugSessionManager
Debug session ended.
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using Microsoft.Extensions.Configuration;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: Convert to binary
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using System;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: using System;
[info]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.RunCodeActionService
Applying code action: Use discard '_'
C# log
Getting latest OmniSharp version information
Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done!
Getting latest OmniSharp version information
Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done!
Getting latest OmniSharp version information
Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done!
Getting latest OmniSharp version information
Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done!
Getting latest OmniSharp version information
Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done!
Getting latest OmniSharp version information
Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done!
Getting latest OmniSharp version information
Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done!
Environment information
VSCode version: 1.50.1 C# Extension: 1.23.5
Mono Information
OmniSharp using built-in monoDotnet Information
.NET Core SDK (reflecting any global.json):
Version: 3.1.403
Commit: 9e895200cd
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/3.1.403/
Host (useful for support):
Version: 3.1.9
Commit: 774fc3d6a9
Yes, not sure if that is related as in the above I'm seeing certain errors persist on files that are otherwise being analyzed, I think there may be a separate issue around namespace discovery (adding or moving files) where those files don't get included for analysis until Omnisharp restart.
Issue Description
Certain error types are reported by omnisharp but do not disappear when fixed; a manual restart or build is required to make omnisharp recognize the code is now valid.
I can reproduce with the BOM rule (SA1412) reliably; I've also seen it intermittently with newlines following opening brace (SA1505).
Steps to Reproduce
Expected Behavior
Omnisharp removes errors no longer present in codebase
Actual Behavior
Omnisharp hangs on to reported errors until next build
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.50.1
C# Extension: 1.23.5
Mono Information
OmniSharp using built-in monoDotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.1.403 Commit: 9e895200cdRuntime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/3.1.403/
Host (useful for support):
Version: 3.1.9
Commit: 774fc3d6a9
.NET Core SDKs installed:
3.1.403 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: