How to manage dll files with git?

Ashutosh Pandey asked on March 10, 2020 19:44

I got an existing Kentico 10 project on production server. It is working fine. The project was added to git as well. First I copied to my local system as a zip and extracted, it worked fine.

When I cloned the same project from GIT, it showed me lot of errors which took me lot of time to figure out. Finally, I found out that /bin folder was missing various DLL files.

My question here is:

Should we add all DLL files also from /bin directory to GIT? Or from Visual studio, should I build or do something so that I get all missing DLLs in my project?

Recent Answers


Brenden Kehren answered on March 10, 2020 19:50

This is your personal preference IMHO.

BUT if you're working with a client or your company who doesn't have a build server/process then you're best to store those DLLs in the repository so they can all be deployed with the project. Be careful of what you pull down on your production machine though as your whole source code repo could be exposed on that server.

0 votesVote for this answer Mark as a Correct answer

Zach Perry answered on March 10, 2020 19:51

Do you have the lib folder in git? I believe most of the DLLs in the bin folder come from the lib folder, and get copied as part of a post build event.

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on March 11, 2020 01:54 (last edited on March 11, 2020 01:57)

You may need to restore nuget packages. lib folder is important - these core Kentico dlls (most of those you can get via nugets, but Kentico is shipped with this lib folder) What happens during the build is that the dlls from lib folder referenced in your .cproj ( check and you will see tons of references to <HintPath>..\Lib\ ...) are being copied to bin.

You do not need BIN and OBJ folders and you must be able to delete BIN and OBJ folders without any problem.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on March 11, 2020 02:23

Peter, Kentico 10 does not have nuget packages that I'm aware of.

If the OP has a website vs a web project, deleting the bin directory and associated dlls will break the sites.

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on March 11, 2020 03:36

Brenden, I totally forgot about the web site installation. Haven't used it in awhile. If you have packages.config in your root folder - that means you are using nugets. I dont version 10 installed (so I cant confirm), but it exists in 11.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.