dotnet --info output:
.NET Command Line Tools (1.0.0-preview2-003131)
Product Information:
Version: 1.0.0-preview2-003131
Commit SHA-1 hash: 635cf40e58
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.11
OS Platform: Darwin
RID: osx.10.11-x64
VS Code version:
1.6.0
C# Extension version:
1.4.1
Open a project with several errors/warnings in it (a project that you can replicate this bug in is available upon request).
Omnisharp displays all errors/warnings in the Problems window in VSCode
Omnisharp only displays a few or no messages even though in the omnisharp log I can clearly see them and have verified that they are valid errors/warnings (or... at least sometimes the log contains all warnings/errors, sometimes it does not). I have uploaded my omnisharp log here.
This is in a clean install with no other extensions. The project is a Unity project, but I doubt that should matter.
VSCode also logs "Some projects have trouble loading. Please review the output for more details." however I cannot see anything suspicious in the log even with verbose logging enabled. Though it is pretty large so I might have missed something.
Restarting VSCode or the Omnisharp server does not solve it.
I have not tried to reduce my project to a smaller size and checked if it still happens, but I am more than happy to share my project with anyone to try to debug it.
For a while it would simply display one or sometimes a few warnings (I was fixing a lot of unused 'using' declarations) and I had to fix the single warning that was displayed, wait while it re-processed everything and then fix the next warning that would then show up.
Hi, if this is a largeish Unity project (e.g. >= 1000 .cs source files), this is generally expected. In that case, the extension will only retrieve errors and warnings for open files to avoid constantly chewing CPU.
FYI, the link to your omnisharp log does not work me.
Hi
It is large, but nowhere near that large.
$ ls **/*.cs | wc
273
In any case, the files were open.
Huh, that's odd, it works just fine for me.
I'd love to take a look at your project if you're able to provide it. Perhaps we broke something. Also, you might consider trying the latest beta of the C# extension available here and see if that improves the issue.
Also, you might consider trying the latest beta of the C# extension available here and see if that improves the issue.
Ok, is it possible to install that from within VSCode or do I have to do some manual work here? (this is literally the first time I have tried using VSCode, so I am not very familiar with how the plugins work yet).
I will send you an email.
FWIW, the warnings in the log are produced when OmniSharp uses MSBuild to perform a design-time compilation of your project in order to gather up source files and references. However, OmniSharp does not return those. There's a separate endpoint that requires errors and warnings live from your code.
Ok, is it possible to install that from within VSCode or do I have to do some manual work here? (this is literally the first time I have tried using VSCode, so I am not very familiar with how the plugins work yet).
You can install it within VS Code. Go to the Extensions pane, click the three dots at the top-right of the pane and select "Install from VSIX..."
FWIW, the warnings in the log are produced when OmniSharp uses MSBuild to perform a design-time compilation of your project in order to gather up source files and references. However, OmniSharp does not return those. There's a separate endpoint that requires errors and warnings live from your code.
Ok, but it is supposed to be able to get those warnings/errors from the other endpoint as well, right?
You can install it within VS Code. Go to the Extensions pane, click the three dots at the top-right of the pane and select "Install from VSIX..."
Installing the beta did not seem to resolve the problem unfortunately. Here is the log for the beta version: http://pastebin.com/r7gh70Bd
I sent you an email with the project.
I think I am experiencing something similar. I attempted to install the previously mentioned beta version with no change. For me the errors show up for a second after saving and then disappear. I have a short video of it (please forgive the watermark). I found that this bug came about after updating to the just released version of VSCode (v1.6)

@bsell93 I also saw that once. The errors were not valid however, I think it was because I had just deleted some files and Unity had not rewritten the project file, so omnisharp was logging errors about that. I don't think it is related to this issue however.
I see. Yeah, I am not sure what is going on. They are definitely errors, because I intentionally made them 馃榿.
I have the same problem. This happened after the update VS Code to version 1.6
I found a solution: in v.1.5.3 all working.
@shlapkoff were you referring to mine or @bsell93's problem?
@shlapkoff thanks! That fixed my issue!
I see, so this is a recent regression with 1.6? @jrieken, have you heard any other reports of the Problems pane not displaying all errors & warnings?
@DustinCampbell For me downgrading to 1.5.3 did not work unfortunately.
As you can see in the screenshot, warnings are still not displayed.
I verified that it does check for some thing though, if I make an obvious syntax error like removing a semicolon, then it will complain.

Is there anything else I could try to help you debug this issue?
Did you manage to replicate it in the project that I sent you?
I'm getting this constantly with a .NET core solution as of VSCode 1.6, too. Errors appear for a second, then totally disappear.
But e.g. dotnet build in the terminal fails because those errors are actually totally valid.
@HalfVoxel Can you check the output of the developer console in VS Code? That might contain some useful data to let me understand this better/
@HalfVoxel I have in mind the problem @bsell93
@HalfVoxel re https://github.com/OmniSharp/omnisharp-vscode/issues/812#issuecomment-253217086 - just to clarify: you see this with 1.6 and also 1.5.x? or only with 1.6?
@jrieken I see this with both 1.5.3 and 1.6.
It is primarily warnings that I am concerned about though, it seems to handle errors better (but I haven't tested it extensively). Sometimes when it initially shows no warnings, I can make an error in the file and then it will show me both the error and an unrelated warning that didn't show up before (I might have to double check this one, but I am pretty sure that was what happened).
Sounds like it's under control, but just in case:
Extensions:
EditorConfig for VS Code 0.3.3 (latest)
Nomo Dark Icon Theme 1.1.4 (latest)
ESLint 1.0.8 (latest)
C# 1.4.1 (latest)
Vim 0.3.7 (latest)
VS Code: 1.6.0, on Arch Linux x64 using visual-studio-code from the AUR, package version 1.6.0-2
(The visual-studio-code package grabs a debian/ubuntu release, strips symbols from the official binaries, and repackages them.)
Shot of developer tools on re-opening VS Code, introducing a syntax error which quickly disappears, with a bunch of tabs open:

Slightly cut-down (unrunnable but buildable) version of my pure C# project which shows the issue (1.7MB):
https://calpol.us/files/public/Blamalama-minim.zip
Repro:
Potentially of interest here: I use a few extensions, I have a .sln file and a global.json and a .xproj file I don't actually use, and there is a fair bit of C# in here using dynamic and unsafe and plenty of PInvoke declarations.
In my recent attempt, I got no console errors doing this. Even though I reproduced the 'syntax error disappears' issue successfully. _shrugs_
Above project is not open source, and is not licensed for wider distribution except in aid of fixing VS Code & Omnisharp issues. I will remove the link once this issue is solved.
If you need any help, ask. If needed I can try specific VS Code builds, or provide more files, or potentially remote desktop access.
edit OmniSharp log: http://pastebin.com/u8i0ivJj
Given this is affecting Unity workspaces too, perhaps this is related to having >1 project in a workspace?
@HalfVoxel Can you check the output of the developer console in VS Code? That might contain some useful data to let me understand this better/
The developer console (assuming you mean the chrome dev tools) unfortunately logs exactly nothing. I watched it while restarting omnisharp and having a file opened which contains things it should warn about.

Does Omnisharp actually check for those warnings at all (assigned but not used private fields)?
Don't think so. But my repro steps require the user to specifically introduce a syntax error; the .zip as-is is buildable.
@leafi: You might try the latest beta of the C# extension and see if that addresses the issue that appears in your Developer Console in the DefinitionMetadataDocumentProvider. That problem should have been fixed with https://github.com/OmniSharp/omnisharp-vscode/commit/58f7e7950222278d2126f620c2e89ca6e7907c9c.
@DustinCampbell: Thank you. Indeed it (1.5.0-beta3) does. This issue, the errors disappearing issue, still occurs with that build FYI.
Yeah, I didn't think it'd fix that issue, but it would remove some of the noise in the Developer Console.
What remains is: an [Extension Host] Error: Unsupported linux platform and a few [Extension Host] _isHugeProject = false (0) lines.
_isHugeProject = false (0) is harmless. That's a bit of debugging text I forgot to turn off.
Error: Unsupported linux platform is equally harmless. That's just the debugger doing a check and determining whether it can run on the current Linux distro (you're on ArchLinux, right?). The debugger check is here.
@leafi Thanks - I can repo with your sample, drilling into the cause of this now
@DustinCampbell Pretty sure this is a bad equality check in the DiagnosticsProvider - it compares tuple[0] === uri which are both vscode.Uris but (sadly) not triple-equals comparable.
In the debugger, I can see how I first get a set-diagnostics call and later a clear call.

Obviously this doesn't answer the question why _some_ people only see this on 1.6. Maybe extra awareness in the face of a new release or a side-effect from the reworked diagnostics internals on our side.
Thanks for the analysis @jrieken! I suspect this was just hiding under to the performance issues you fixed in this release. Now that those are gone, this has bubbled to the top.
FWIW, that bit of code was an attempt to try and improve performance, but I don't think it's necessary any longer with all of the diagnostics performance fixes that went into 1.6.
Thanks lads. Hacking my local, already-transpiled copy of the extension (in diagnosticsProvider.js) to remove the lines proposed by PR #820 does indeed fix the issue for me.
I look forward to getting my squigglies back on an official basis. Thanks again for looking into this.
@leafi: Glad to hear it!
v1.5-beta4 of the extension is now available containing this fix.
File on that release is called -beta3.vsix
Sigh... it's early. :smile: Will fix shortly.
Fixed :smile:
Thx. v1.5-beta4 indeed fixes the issue.
Confirmed working for me as well! Good job!
@DustinCampbell Not sure if I'm seeing a different issue, or this is just how its supposed to work, but I'm not seeing errors where I expect to see them. Here's what I'm doing:
project.json files and codeprojects array pointing to each proejct folderdotnet buildAt this point, I don't see any of the errors I see from dotnet build in the bottom ribbon or the "Problems" pane.
I assumed this was because I need to somehow explicitly trigger a build through Omnisharp, but I can't find a way to do so. The only two Omnisharp related options I have available in the command palette are: "Omnisharp: Restart Omnisharp", and "Omnisharp: Select Project", and I've already used the latter to select the project containing the errors. I also tried running "Tasks: Run Build Task", but this results in the output:
Couldn't find 'project.json' in current directory
Here's what the Omnisharp generated tasks.json looks like:
{
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"tasks": [
{
"taskName": "build",
"args": [
""
],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
}
]
}
I'd appreciate any guidance on whether I should be expecting errors to pop up as I work (and so there is a bug), or if I need to build the projects through VS Code using some approach I've missed.
The project I'm working with is a Github fork, so if this is an actual bug rather than PEBKAC, I can push up all my work and give you a link.
I tried to install the 1.5-beta4 version, and this was the result:

@aggieben installing .vsix's by hand is sadly pretty confusing. You can NOT double click them. Instead you need to open them as a file from VS Code.
That's right. In VS Code, select View->Extensions. Then, at the top-right of Extensions pane click the [...] and select "Install from VSIX..."
@DustinCampbell Any thoughts on my earlier comment? Is the discrepancy between dotnet build and the Omnisharp errors log as intended, or is there some action you need to take for Omnisharp to show you the same errors?
@masaeeedu: Sorry for the delay. What you described doesn't look like the same problem that everyone else was experiencing in this thread. Could you file a separate issue? Also, if you have a project that reproduces the problem, that'd be helpful too.
I have the beta4 extension installed now, and after the last code update (1.6.1), this issue is manifesting again. Update: it seems to only be happening for some files. Not sure what's going on.
I still have this issue and I'm using VS Code 1.6.1 and Omnisharp 1.5.0-beta4. I have multiple projects with a global.json file.
The issue as originally filed was about .csproj/.sln on Unity projects. For any experiencing this issue on project.json, could you please file a separate issue?
I'm using VS Code 1.6.1 and and Omnisharp 1.5.0-beta4 for my Unity project, the issue here was solved but the flame icon used to show "xxxx.sln" now says "0 projects" even through I select the .sln in the list. Other than that everything is fine.
Today installed 1.7.1 and the issue is back again. Need help guys cant really work like this. (Tried uninstalling and reinstalling 1.5.0beta4 without result).
@DustinCampbell I've put up repro steps for a project.json codebase in #843.
OK. I'm going to close this issue. The latest bits are working for most folks and new issues have been opened for further work.
same here, when I move the cursor, the red underline squiggles disappear.
Not sure why this issue keeps getting closed, it's quite an alive and real bug ;)
I tried the patch csharp-1.5.0-future-preview1.vsix but same issue