gitignore and nuget

https://www.gitignore.io/

  • Super useful!

 

I recently ran into an issue – after downloading my c# project from github, i could not build the project. basically on compilation, the project was complaining saying there were missing references and such.

  • When i opened nuget manager, it showed the packages were all installed.
  • The packages folder was present.

It seemed the problem was because VS was assuming that the packages are there, so it was avoiding downloading the packages again. However, the content inside the ‘packages’ folder was not complete – aka .dlls were missing from the packages folder because there had been git-ignored.

It seems I had not done the gitignore properly !  In the references below, there is an example of how to gitignore VS projects properly.

<snip>

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

</snip>

 

References:

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s