BrooklynSon
BrooklynSon

Reputation: 2103

Where DLL file should be place in .NET web application

In a C# ASP.NET Web Application I'm structuring it with the web application on the top, and then multiple projects for handling business layers and a data access layer. I have a DLL file that contains SQL Helper. Should that be placed in the bin of the Web Application or a folder I create named 'lib' in the root of the Web Application.

Lastly since it is a DLL dealing with data access should I place it in the project containing the data layer classes that will be referencing that DLL and if I do how should I place it in that project(type class library).

Thanks for all the considerations.

Upvotes: 0

Views: 5992

Answers (2)

SimonGoldstone
SimonGoldstone

Reputation: 5216

ASP.NET applications look in the \bin folder for DLLs, so you can put any DLLs in there. If the DLLs are shared across many applications, however, it may make sense to install in the GAC.

(You might need to click the "Show All Files" button at the top of the Solution Explorer to see the \bin folder).

Like @Paul Zahra says, I prefer the \bin solution to the GAC though, because you can XCOPY deploy, which suits your requirements.

Upvotes: 1

BLoB
BLoB

Reputation: 9725

Have a folder outside of the web solution folder called assemblies, use this folder as a central repository for DLLs. Have all of your projects within the solution building to that folder, and create references to DLLs within your solution to that folder. It will aid in deployment and DLL version management. I prefer doing this to using the GAC.

Upvotes: 1

Related Questions