Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does visual studio exclude BIN and OBJ folders at Azure DevOps checkin

I want to know what is the generic way to check-in code on Azure DevOps from Visual Studio or Git-Bash that has been coded in Visual Studio. The problem that occurs is the bin folder contains many third party dll's which are kept in the source before building the project. Those third party dll's are necessary to project. However after check-in to Azure DevOps the bin and obj are not present. This happens due to .gitignore and .gitattribute files. I have deleted both the files and checked in the bin folder as of now. What is the purpose of these two files. Can someone please suggest a way to resolve.

exclude

like image 230
Salman Avatar asked Dec 08 '22 13:12

Salman


1 Answers

.gitignore file specifies the untracked files. .gitattributes defines attributes per path. They are configuration files of Git.

In Visual Studio, the bin and obj folders are used to store the output generated by compilers (see here). As these output files are generated by compilers, you don't want to track them in the source control.

If your project need to reference to some 3rd party dlls, the best approach is to reference to them as Nuget packages if there are Nuget packages available for the dlls. If not, you can put them in a folder other than bin or obj so they can be tracked in Git. You should not change .gitignore to track bin or obj folders.

like image 100
Chun Liu Avatar answered May 08 '23 13:05

Chun Liu