_From @davkean on March 24, 2016 17:28_

While it's currently supported to use *.cs in a project system, we blow it away the minute you make any changes, such as adding new files, exclude files, or changing metadata. We should make this better.
_Copied from original issue: dotnet/roslyn#10066_
We need to handle excluding folders and files.
It would be awesome if MSBuild could be configured to use .gitignore as its file exclusion filter.
FANTASTIC idea, @asbjornu ... and I am not just saying that because I have thought of that,too. :smile:
The problem of course is that you are now tightly-coupling with an external technology. However, that doesn't mean that you could design this solution in such a way so that you could use providers for ignored files, Git being one of them. GitResourceProvider sounds like a good name to start with. :sunglasses:
I will say that I am in the minority here and prefer the "opt-in" model of project files (listing all files and then being able to remove them from the project), but that doesn't mean I am opposed to the opt-out model (Git, project.json), as long as the user experience is the same.
Most helpful comment
It would be awesome if MSBuild could be configured to use
.gitignoreas its file exclusion filter.