48

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?

eKek0
  • 23,005
  • 25
  • 91
  • 119
  • 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. – Wasted_Coder Jan 20 '22 at 12:29

1 Answers1

43

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?.

Community
  • 1
  • 1
akton
  • 14,148
  • 3
  • 43
  • 47
  • 3
    Do you know if NuGet has an option for downloading the specific version of each package, to avoid the conflict you suggested? – TTT Feb 27 '13 at 15:26
  • 1
    @TTT See http://stackoverflow.com/questions/5628689/download-old-version-of-package-with-nuget for instructions on downloading specific versions through NuGet rather than just the latest version. – akton Feb 28 '13 at 00:45
  • You didn't actually answer the question though. What folder can we find the packages? – AustinWBryan Apr 29 '18 at 02:22
  • @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 "https://learn.microsoft.com/en-us/nuget/consume-packages/ways-to-install-a-package#what-happens-when-a-package-is-installed". – akton Apr 30 '18 at 06:26