What does the small preceding red minus icon mean in my Visual Studio Solution Explorer?

18,391

Solution 1

According to the version control icon documentation, it indicates files that have been excluded from version control, for example in the .gitingore file.

Icon for excluded from version control

However, in my case with Visual Studio Community 2015 Update 2, those icons also show up when I create a new project. Even if none of the created files are explicitly ignored through .gitignore. The icons disappear once I've committed the changes.

Solution 2

For those who are getting this on Visual Studio 2019, I found that clicking on "Add Ignored File File to Source Control" under Source Control solved this for me and finally added the files for commit on my Git repository:

Add Ignored File

Solution 3

When you create a visual studio project and select the "add to source control" option and you are using Git, Visual studio automatically generates a .gitignore file.

The .gitignore file contains a large amount extensions and directories. For instance:

  1. User-Specific files such as *.suo, *.user etc.
  2. Build Results, DNS artifacts
  3. Profiler, Resharper, JustCode and TeamCity and many other add-ins artifacts
  4. SQL Server files *.mdf and *.ldf

I think you get the idea, you can open the .gitignore and view it yourself.

You can right-click on the file that is being ignored and include it in your source if you wish.

This is the behaviour in Visual Studio 2015. I haven't confirmed if this is the behaviour in previous Visual Studio editions.

Solution 4

I think I managed to figure out what is going on here.

The (-) symbols next to each of your files/projects represent files that are ignored by .gitignore.

From what I am seeing in your project, this would mean that you ignored the files in your .build and .misc folders.

As for the (-) symbol next to your solution, I think this means that you have also ignored your .sln in your .gitignore file.

Likewise, if you were to add the .csproj files in your .gitignore, I would expect a (-) symbol next to your projects like Sliders.Core.Test.

Hope this helps.

Share:
18,391

Related videos on Youtube

g.pickardou
Author by

g.pickardou

Developing mainly in C language family, like C# (C++, Java) JavaScript, TypeScript. Honoring the greatest in our profession like Neumann, Ritchie, Kernighan, GOF, (Martin) Fowler and many others. Not honoring the shallow ones who try to earn cheap popularity by writing clickbait blogs using the terms like "antipattern" associated with the name of the greats.

Updated on September 15, 2022

Comments

  • g.pickardou
    g.pickardou over 1 year

    Recently a preceding small red icon started to appear before some of my VS 2015 Solution Explorer. I definitely remember it was not there some days before.

    I think it has something to do with git source control what I am using (not sure), but can not figure what is it.

    * edit *

    Added more diagnostics:

    • The files can be opened by double click
    • The tracking does not work for these files (I mean not activated in Solution Explorer when switching to the editor tab for that file)
    • Editing and saving does not help
    • Close/Reopen VS does not help
    • Refresh does not help

    * end edit *

    enter image description here

    • g.pickardou
      g.pickardou over 8 years
      No, unfortunatelly I could not figure it out... The only thing about it, that this solution folder is a git repo, and it has a parent folder which also a separate git repo.
  • Cool Blue
    Cool Blue about 7 years
    Great link, but I can't tell from the page how it was navigated too... any clues?
  • Lernkurve
    Lernkurve about 7 years
    @CoolBlue I don't understand what you mean by "how it was navigated too". Could you elaborate?
  • Cool Blue
    Cool Blue about 7 years
    Sorry, I mean what section was it under in the index on the left of the page? Like, how did you find it? Its like a maze but there is lots of good information in there and I'm trying to get myself orientated.
  • Lernkurve
    Lernkurve about 7 years
    @CoolBlue I googled for something like meaning of icons in Visual Studio solution explorer and that link was on the first page; didn't navigate to it. However, check out this page: it's older but it has a breadcrumb navigation bar at the top which shows the structure. Microsoft knows that MSDN has grown to become intransparent, and that's why they're working on the new documentation site docs.microsoft.com.
  • Cool Blue
    Cool Blue about 7 years
    Ok, thanks. And glad to hear it's not just me! :p MS seem to be finally realising the ROI on a capable tech publishing process. It's amazing how bad they are at it until now :/
  • zokaee hamid
    zokaee hamid over 4 years
    thank you but this message shows in your link " We're no longer updating this content regularly. Check the Microsoft Product Lifecycle for information about how this product, service, technology, or API is supported."
  • Rodri
    Rodri over 2 years
    I can confirm that this still happens in Visual Studio 2019