question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problems list broken when Roslyn Analyzer is enabled

See original GitHub issue

Problems list is only showing issues from files just opened in editor if “Roslyn Analyzer” is enabled and “Analyze Open Documents Only” is disabled. This is true for Errors, Warnings and Infos (which are all not filtered in the problems list). Note: “Max Project File Count For Diagnostic Analysis” is set much higher than the actual file count and does not even show any effect when set to 0 or negative.

Steps to Reproduce

Settings:

  "omnisharp.useModernNet": true,
  "omnisharp.enableRoslynAnalyzers": true,
  "csharp.maxProjectFileCountForDiagnosticAnalysis": 10000

Expected Behavior

All Errors, Warnings and Infos across all *.cs files in the workspace are listed under problems.

Actual Behavior

Any Errors, Warnings and Infos of one *.cs file are listed only once that file has been opened in editor. (Any errors in files not being opened are never being listed.) Once "omnisharp.enableRoslynAnalyzers": false is set - all errors are listed again as expected.

OmniSharp log

Starting OmniSharp server at 4/14/2022, 10:39:08 AM Target: d:\proj\xxx

OmniSharp server started with .NET 6.0.103 . Path: c:\Users\chr.vscode\extensions\ms-dotnettools.csharp-1.24.4-win32-x64.omnisharp\1.38.2-net6.0\OmniSharp.dll PID: 12388

    Starting OmniSharp on Windows 10.0.19044.0 (x64)
    Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
    Using the 'dotnet' on the PATH.
    DotNetPath set to dotnet
    Located 1 MSBuild instance(s)
        1: .NET Core SDK 6.0.103 17.0.0 - "C:\Program Files\dotnet\sdk\6.0.103\"
    Registered MSBuild instance: .NET Core SDK 6.0.103 17.0.0 - "C:\Program Files\dotnet\sdk\6.0.103\"
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
    Queue project update for ...

… info: OmniSharp.WorkspaceInitializer Configuration finished. info: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location ‘d:\proj\xxx’ on host 14932. info: OmniSharp.MSBuild.ProjectManager Loading project: … … info: OmniSharp.Roslyn.CSharp.Services.Diagnostics.CSharpDiagnosticWorkerWithAnalyzers Solution initialized -> queue all documents for code analysis. Initial document count: 286.

Environment information

VSCode version: 1.66.2 C# Extension: 1.24.4

Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.103 Commit: 2d7bc7059f

Runtime Environment: OS Name: Windows OS Version: 10.0.19044 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.103\

Host (useful for support): Version: 6.0.3 Commit: c24d9a9c91

.NET SDKs installed: 1.1.4 [C:\Program Files\dotnet\sdk] 2.1.300 [C:\Program Files\dotnet\sdk] 2.1.805 [C:\Program Files\dotnet\sdk] 2.1.818 [C:\Program Files\dotnet\sdk] 3.1.405 [C:\Program Files\dotnet\sdk] 3.1.417 [C:\Program Files\dotnet\sdk] 5.0.212 [C:\Program Files\dotnet\sdk] 6.0.103 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
cpptools ms-vscode 1.9.7
csharp ms-dotnettools 1.24.4
data-workspace-vscode ms-mssql 0.1.1
gitlens eamodio 12.0.6
json-pretty-printer euskadi31 1.1.0
jupyter ms-toolsai 2022.3.1000901801
jupyter-keymap ms-toolsai 1.0.0
jupyter-renderers ms-toolsai 1.0.6
live-html-previewer hdg 0.3.0
mssql ms-mssql 1.13.0
python ms-python 2022.4.1
sql-database-projects-vscode ms-mssql 0.14.1
swagger-viewer Arjun 3.1.2
vscode-arduino vsciot-vscode 0.4.11
vscode-commons redhat 0.0.6
vscode-docker ms-azuretools 1.21.0
vscode-postgresql ms-ossdata 0.3.0
vscode-pylance ms-python 2022.4.1
vscode-xml redhat 0.20.0
vscode-yaml redhat 1.6.0
xslt-xpath deltaxml 1.2.3
output from your clipboard

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
Dryadxoncommented, Sep 14, 2022

Since no feedback was given by an O# developer, I made a pull-request of the fix, which in my opinion, should be applied.
Hoping that this does not irritate anyone, I would have preferred to receive guidance before doing so.

1reaction
Dryadxoncommented, Jul 9, 2022

I did a git bisect today after learning about this issue, and thanks to @rjgotten it was really quick to do. The culprit of this problem seems to be the commit 6c306e8888be4f53423d7f4d253777e53c661ee4, and restoring the only file it touches solves the issue, tested by building the latest stable version 1.25.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error list shows no errors or warnings - Visual Studio Feedback
I run a build, the build log has errors and warnings - some from the compiler, some from Roslyn analyzers - and they...
Read more >
Analyzer configuration - Visual Studio (Windows)
Learn how to customize Roslyn analyzer rules. See how to adjust analyzer severities, suppress violations, and designate files as generated ...
Read more >
Roslyn Analyzers not working after converting to new csproj
We recently converted a .NET 451 solution to the new csproj structure. In doing so our custom Rosyln analzyers (referenced as a nuget ......
Read more >
Solution-wide analysis | JetBrains Rider Documentation
View the list of errors/warnings in solution · Choose View | Tool Windows | Problems from the main menu or press Alt+6 ,...
Read more >
Roslyn Analyzer - tips and tricks (Part 5) - Always Developing
Compatibility. If an analyzer is created in Visual Studio 2019 using the Analyzer with Code Fix project - it will not be initially...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found