Bin folder

ASP.NET recognizes the "bin" folder of a site as a special folder for specific types of content. A "bin" folder is meant to contain compiled assemblies (.dll files) for custom ASP.NET controls, components, or other code that you want to reference in your ASP.NET web application.

You can store compiled assemblies in the "bin" folder, and other code anywhere in the web application (such as code for pages) automatically references it. A typical example is that you have the compiled code for a custom class. You can copy the compiled assembly to the "bin" folder of your web application and the class is then available to all pages.

Assemblies in the "bin" folder do not need to be installed in the Global Assembly Cache (GAC). The presence of a .dll file in the "bin" folder is sufficient for ASP.NET to recognize it. If you change the .dll and write a new version of it to the "bin" folder, ASP.NET detects the update and uses the new version of the .dll for new page requests from then on.

Putting compiled assemblies into the "bin" folder can represent a security risk. If you wrote the code yourself and compiled it, then you know what the code does. However, you should treat compiled code in the "bin" folder as you would treat any executable code. Be wary of compiled code until you have tested it and are confident that you understand what it does.

Community Additions