Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio showing false errors

I was working on a project, and I usually before doing anything I create new branches.

In my feature branch, Visual Studio wasn't showing any errors. It was doing all good.

Well, I switched from my feature branch to my develop branch and it shows me errors when it didn't before.

But there are no errors, since I build the solution and it succeeds. It runs perfectly.

enter image description here enter image description here

First time this actually happens to me. :/

like image 387
RottenCheese Avatar asked Oct 20 '17 20:10

RottenCheese


People also ask

How do I get rid of errors in Visual Studio?

You can change this behavior by going to Tools -> Options -> Projects and Solutions -> General and deselecting the "Always show Error List if build finishes with errors".

How do you fix there were build errors Visual Studio?

Tools > Options > Projects and Solutions > Build and RunThe selection in the second dropdown “On Run, when build or deployment errors occur”, even if the code has the error during the run, project runs with the last successful build.

How do I show errors in Visual Studio?

To display the Error List, choose View > Error List, or press Ctrl+\+E.


2 Answers

It's because VS uses for editor other implementation then while building, and sometimes it fails to follow files modification. Sometimes it helps to reopen the solution, sometimes you should close the solution, remove cache files (they should be a file or subdirectory next to the solution file) and reopen the solution.

like image 112
max630 Avatar answered Oct 18 '22 03:10

max630


This happened to me when the .NET Framework for the referenced project was higher than the referencing project.

like image 33
Edward Bagby Avatar answered Oct 18 '22 03:10

Edward Bagby