0

I am just learning and following a tutorial on how to create a web project. When I create the new project I do see two new folders called bin and obj. I have read what these are but I am confused as to why when they are created they are not 'included'. These folders are white and the others are yellow. If I right click on the folder it provides the option to Include in project. But the other folders provide option to 'Exclude from project. So I have a few questions: 1. Why aren't these folders automatically included in the project? 2. Should I automatically include in the project? 3. Is there any reason not to include these folders in the project?

kpetry
  • 11
  • 1

1 Answers1

3

The bin and obj folders are for temporary files. They are created and filled automatically when you build your application.

  1. Why aren't these folders automatically included in the project?

The files aren't automatically included in the project because they aren't really part of the project. They are the results of the project. In other words, you won't be editing the files in the bin and obj folders directly.

  1. Should I automatically include in the project? 3. Is there any reason not to include these folders in the project?

You should not be including these folders in your project because they are temporary and the contents will be deleted, created, and changed without updating the project (.csproj, .vbproj, etc.) file when you build, rebuild, or clean your solution. Visual Studio looks at the project file to figure out which files to show you through its user interface.

You don't want to be checking for files to include in your bin and obj folders every time you build your solution. Just know that these folders will be used behind the scenes when you debug or publish your web application.

Nick
  • 14,291
  • 3
  • 17
  • 19