Excluding the Bin Folder From Source Control in a Web Project


When creating a web project in Visual Studio .NET 2005, the bin folder gets exposed to source control.  Normally, the bin folder is how the web project keeps track of the project references.  When a project reference is added to the project, the .dll is copied to the bin directory.  However, in a source controlled environment, this copy is "noticed" by Visual Studio 2005 and exposed to the source control process.  This means that you can check in .dlls added to the bin folder.
This becomes an issue if you need to auto-update or refresh the bin references.  If the files are under source control and are being replaced (either by updating or adding and removing) the .dll in the bin folder needs to be checked out.  This becomes an issue if more than one developer is working on the project in a shared source control environment.  What will happen is if there are changes to the references made by more than one person, the project reference change can't happen unless the content of the build folder is available for checkout
Additionally, this becomes a problem in both Team Foundation Server and VSS.  However, in TFS, you can select to modify the checkout type of .dll files to shared checkout (use Team - Team Foundation Server Settings - Source Control Settings and modify the contents of the entry that has .dll files and disable multiple check out.  This will allow others to check it out.
Alternatively, you can make the bin folder hidden.  As long as the dlls show up in the bin directory, there won't be the danger of adding them to source control.  However, developers will manually have to administer this directory.  Another approach is to undo the addition of items to this bin directory in source control.  Just copying the dlls to the bin directory will allow the project to compile
Watch out for this though when running the merge process for ASP.NET.  It does not like the hidden bin and I found myself having to change it back.

Comments (1)
  1. kashif999 says:

    Hi,
    I have one issue, that our server all .net web applications BIN folder is not being visible. But when try to see its contents from command prompt then visible. Is there any virus issue or is there any configuration of .NET that we can make BIN folder hidden and cannot be seen in windows explorer, and also when we try to create another bin directory anywhere in server, it doesnot allow to create with BIN name.
    If you are aware of this issue, then do tell us.

    Regards,

Comments are closed.

Skip to main content