'Why folders in VS 2019 shows red cross 'X'?

enter image description here

My Observation:

  1. Its for empty folders or for empty folder hierarchy.
  2. If I add the folder again then cross is removed. (I have re-sharper installed, and don't know if the cross coming from there.)


Solution 1:[1]

It's for folders that are added in you .proj file, but doesn't exist on a hard drive.

My guess is that you are using some kind of version control (git or svn or else) and someone made change to project structure (added folder) but forgot to add that folder to version control system.

Solution 2:[2]

For me red cross appeared on all projects because while cloning component from git/stash, most of the files and folder path were too long and are not acceptable.

Tried cloning at different path which is smaller and red crosses disappeared.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alexandr Denschikov
Solution 2 Himani