What is the packages directory in Visual Studio? Should I include it in SVN?

30,962

It sounds like you are using NuGet and the packages folder is the NuGet packages folder. You can commit this to source control if you do not mind adding several large but infrequently changing binaries.

Alternatively, you can omit it from source control and configure NuGet to download packages on each build if developers and the build machine are to download it as required. This also runs the danger of someone downloading a newer version and causing conflicts.

As for other files to exclude form source control, see What .net files should be excluded from source control? and For a .Net project, what file extensions should I exclude from source control?.

Share:
30,962

Related videos on Youtube

eKek0
Author by

eKek0

I'm a software developer living in Santiago del Estero, one of the smallest towns in Argentina. I'm also a system analyst, and program in Delphi and ASP.NET with C#. Currently, I'm working in a bank developing in-house software.

Updated on July 09, 2022

Comments

  • eKek0
    eKek0 almost 2 years

    I'm working with ASP.NET MVC 4 in Visual Studio 2010 for the first time, and I control source code with SVN. I used to work with MVC 1 in Visual Studio 2008, where I had my own filter for svn:ignore

    *.pdb
    *.exe
    *.dll
    debug/*
    release/*
    *.user
    *.suo 
    obj/*
    bin/*
    obj
    bin
    VSMacros80
    Thumbs.db
    _ReSharper.*
    

    but it doesn't apply in the same way now because the project has some new folders, as the packages folder, and I don't know which of them must be versioned.

    About the packages folder, should I include it the repository or this folder must be ignored? What other folders or files should I ignore?

    • Wasted_Coder
      Wasted_Coder over 2 years
      Nice filter list! But I like to include some binaries that are required to compile/run the source. I see you exclude everything exect the .cs files basically. I usually include bin, and I also like to include "release" as it contains the releasable compiled code of the source. So I can step back to old revisions of the compiled code as well. *.pdb is used for debugging in windows (like if a process crash or running inf loop). Microsoft is heavy on keeping them, but I also don't keep them.
  • TTT
    TTT over 11 years
    Do you know if NuGet has an option for downloading the specific version of each package, to avoid the conflict you suggested?
  • akton
    akton over 11 years
    @TTT See stackoverflow.com/questions/5628689/… for instructions on downloading specific versions through NuGet rather than just the latest version.
  • AustinWBryan
    AustinWBryan about 6 years
    You didn't actually answer the question though. What folder can we find the packages?
  • akton
    akton about 6 years
    @AustinWBryan The question mentions the "packages" folder in the solution folder. It also asks "... should I include it the repository or this folder must be ignored? What other folders or files should I ignore?", not what it does. If you want to know what it does, see "docs.microsoft.com/en-us/nuget/consume-packages/…".