vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Allow suppression of project load failures

Open estenio12 opened this issue 1 year ago • 5 comments

First I checked vscode to not show me notifications from the extension, but it still continued to appear; Then I went and marked it to not show any notification, only notifications from this extension are going over my configuration and showing the notification.

The big problem is when the extension detects a problem, and then starts reporting the same error over and over again.

Image showing any notification is turned off: Erro C# extensions on VSCode

Image showing C# extension notification is turned off: C# extensions on VSCode marked as off

Image showing my extension installed for C#: My Extensions installed for C# workflow

estenio12 avatar Aug 26 '24 12:08 estenio12

VSCode doesn't allow error messages to be hidden (intentional design decision on their side). I'm not 100% sure if it covers this case, but @estenio12 can you try enabling dotnet.server.suppressLspErrorToasts in VSCode settings to see if that suppresses the toast?

Just an FYI - the error you're seeing indicates there was an issue loading the project. If that error is present you may see limited language feature support for anything that is a part of that project.

dibarbet avatar Aug 27 '24 01:08 dibarbet

Hi @dibarbet!

I did what you recommended, but it didn't work. I checked the box and restarted vscode and it didn't work.

Image showed my setting: Setting Vscode

Answering the question of explaining the problem you explained, what happens: The solution of this project has references from several other different projects, the configuration of task.json and launch.json are customized to execute only what I want to debug.

Maybe a solution for this problem is load sln of extension instead of using my custom launch.json, i will try latter.

estenio12 avatar Aug 27 '24 11:08 estenio12

Got it, we'll see if we can do something to suppress the project load notifications as well. But it likely won't happen immediately.

There are also a couple things you can do if you want the C# extension to ignore certain aspects of the projects when loading them, for example

  1. Use a solution filter (slnf) to include only certain (working) projects (slnf files should be available in the 'Open Solution' command).
  2. Use MSBuild properties to control when certain things are run. For example if you don't want something to happen when the projected is loaded in VSCode for intellisense, you can condition it using the $(DesignTimeBuild) property (which is set to true when the C# extension is loading the project).

dibarbet avatar Aug 30 '24 23:08 dibarbet

I agree this is really annoying. Personally, I use Visual Studio and VS Code side by side when programming C#, doing the programming in VS and all Git related things in VS Code. While no problems with the project in VS at all, VS Code keeps popping up those "problems loading project" notifications, filling up the whole bottom right area of the application. This is only very inconvenient and impractical, it doesn't help or support me, on the contrary. So hereby my vote too for a simple setting to suppress these junk notifications. :)

bvandevliet avatar Feb 04 '25 08:02 bvandevliet

Just to pile on here, these errors are absolutely infuriating and in my case completely inactionable. It's also particularly annoying because I have my Copilot chat window on the right side of the screen, so whenever these errors fire they cover up my chat window and require me to close a bunch of things. There really needs to be a way to turn these off.

ameltzer-MSFT avatar Oct 15 '25 21:10 ameltzer-MSFT