Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does VS2010 allow for the concept of "include in project"?

I'm still learning the basics of how VS2010 sees the world. Apparently, you can optionally "include" a file in a project. I'm a bit confused by this: If a file is version-controlled, AND the file is within the project directory, shouldn't it implicitly be "included" in the project? If not, what's the use case where a version-controlled file in the project directory should NOT be included in the project?

=== Addition ===

Based on the answers I've gotten so far, maybe I should rephrased my question: What does it mean for a file to be "included" in a project?

like image 346
Stephen Gross Avatar asked Dec 06 '22 18:12

Stephen Gross


1 Answers

A project needs to know about files in order for compilation and distribution to occur. Just because you have a file that's under source-control, doesn't mean that it will be compiled if the project is unaware of it.

Also, you may want to include files as part of a distribution package. We do this quite often for our web projects that we distribute using web app gallery.

Conversely, you could have documentation or sql scripts that you version control, but do not want them to be part of the project.

EDIT: In answer to your update, what it means for a file to be included in a project is that the file is actually added to the .csproj or .vbproj file and will be used during compilation and/or distribution. VS does differentiate if the file is Content or if it needs to Compile it. This can be seen by clicking on the file in Solution Explorer and looking at the Build Action property.

like image 89
CAbbott Avatar answered Mar 07 '23 02:03

CAbbott