Using Packages with Version Control
Package Management Systems give us the option of not always committing all the libraries that a project needs into version control.
Open folder in file explorer. And assume we are already committing our project into control system like GitHub.
- Close Visual Studio.
- Typically, we don't committing bin and obj folder. So, we delete it in JsonToDb and databaseModels projects.
- Delete .vs folders too.
- "Packages" directory contains all of the assemblies outside .NET framework.
- When we're using NuGet, we don't need to commit these to version control either. So, delete it.
- Our solution contains only 3 items if we just cloned it from version control system.
- Double click on solution file to open VS.
- We'll see yellow triangle. It means all the references / assemblies couldn't be found.
- Try to build the solution. Runs perfectly?
- Because we using NuGet to manage our dependencies for us. It automatically fetches the packages we need and put them back in solution folder.
- NuGet didn't have to go out the internet to fetch all those. It caches the packages that previously installed in our local folder.