Visual Studio not displaying compile time errors in editor

Visual StudioVisual Studio-2008

Visual Studio Problem Overview


For example, when I write:

string x = "turtle";
x.Go();

There is no red squiggly line detecting the absence of the Go() method on String.

Only when I compile does the error get detected.

I've just upgraded to Windows 7, I have Visual Studio 2008.

In my old environment the errors were detected before the actual compile.

Is there a setting that I am missing?

EDIT: "Tools -> Options -> Text Editor -> C# -> Underline errors in the editor" is checked.

I dont have the "Live Semantic" option. Maybe I need to go to SP1?

Visual Studio Solutions


Solution 1 - Visual Studio

You need to turn on the underline errors in the editor and show live semantic errors options in Visual Studio.

These options can be found here:

> Tools > Options > Text Editor > C# > Advanced > Editor Help

Edit: You will need to install SP1 for this functionality to work.

Solution 2 - Visual Studio

Select Tool -> Options, then Text Editor. Under the language you are using (ie C#), go to the Advanced and make sure the Underline errors in the editor and Show live semantic errors are checked

Solution 3 - Visual Studio

For visual studio 2015 and higher:

Go to: Tools > Options > Text Editor > C# > Advanced > Editor Help

Then select: Enable Full solution analysis

Solution 4 - Visual Studio

Stop the project. Open Folder Project. Delete .vs folder (he is a hidden folder) Then restart Visual Studio

Solution 5 - Visual Studio

I had the same issue and had SP1 installed and had Underline errors in the editor and Show live semantic errors checked in VS2008's options.

My solution was to download Microsoft Visual Studio 2008 Service Pack 1 (Installer) and re-install the package. It wasn't classified as a 'repair' or a 're-install' despite the fact it was already installed, but it worked.

Solution 6 - Visual Studio

Restarting VS solved my problem once.

Solution 7 - Visual Studio

my solution; I know it won't help like 80% of the viewers, but for the sake of who it will: i have had a lot of noise in the IOS part of the solution, a VS bug that showed a lot of errors that weren't supposed to appear, so I just deleted the IOS part because I didn't really needed it as I didn't even had a Mac server to test it on... Something happened after that and the squiggly line returned! Seriously, VS team, fix your bugs...

Solution 8 - Visual Studio

JavaScript Type Checking Sometimes type checking your JavaScript code can help you spot mistakes you might have not caught otherwise. You can run the TypeScript type checker against your existing JavaScript code by simply adding a // @ts-check comment to the top of your file.

// @ts-nocheck 

let easy = true;
easy = 42;

Tip: You can also enable the checks workspace or application wide by adding "javascript.implicitProjectConfig.checkJs": true to your workspace or user settings and explicitly ignoring files or lines using // @ts-nocheck and // @ts-ignore. Check out the docs on JavaScript in VS Code to learn more.

Solution 9 - Visual Studio

In my case the problem was that I created a file with .s extension instead of .cs an then changed the extension to .cs once it was created. I deleted it and created again correctly and now VS is underlining the errors in this file.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiongeejayView Question on Stackoverflow
Solution 1 - Visual StudioAndrew HareView Answer on Stackoverflow
Solution 2 - Visual StudioDan McClainView Answer on Stackoverflow
Solution 3 - Visual StudioNick N.View Answer on Stackoverflow
Solution 4 - Visual StudioClaudinei FerreiraView Answer on Stackoverflow
Solution 5 - Visual StudioBrisslesView Answer on Stackoverflow
Solution 6 - Visual StudioGökhan YalçınView Answer on Stackoverflow
Solution 7 - Visual StudioOri BarmatzView Answer on Stackoverflow
Solution 8 - Visual StudioSrinivasan KasiramView Answer on Stackoverflow
Solution 9 - Visual StudioJavier PallarésView Answer on Stackoverflow