Excluding and Including Files from Compiling for .NET in Microsoft Visual Studio
An incredibly brief explanation, in less than 2 minutes!
You’re developing something, and then, you hit “Compile”. Suddenly, there’s another file from your co-worker that is not working at all (or are conflicting with your file)! Well, maybe, you just want to ignore a certain file from compiling at all.
It’s as easy as one click — Just right click on the file you want to exclude from compiling.
This will make sure that the file you’re excluding will not interrupt any other files, well except if you have dependency toward that file.
But wait! The file is now gone! What happened?
Do not panic, at your Solution Explorer, just click “Show All Files”
From the picture below, you can see that the file is still there, although invisible. You can include it back by clicking “Include in Project”.
Anyway, if you’re wondering how do Visual Studio keeps track of which files to ignore, you can check the .csproj file.
And you’re all set. That is sure very quick right?