ASP.NET Website’s BIN directory and references

asp.netassembliesreferenceshared-librariesweb-site-project

Imagine the following solution:

  • Website ABC.com (not Web Application)
  • BLL (business logic layer in a seperate assembly)
  • DTO (dto objects in their own assembly)
  • DAL (data access layer in it's own assembly as well).

    1. The BLL has a reference to the DAL.
    2. The BLL has a reference to the DTO layer.
    3. The Website project references the BLL.

When one compiles the website project, the following DLLs will appear in the BIN directory:
BLL.dll
DTO.dll
DAL.dll

When one goes to preview the site, an error occurs about not having the necessary assembly references… Now if one right clicks on the website project, Add Reference, and explicitly add the reference to the missing assemblies, it will work fine.

It seems to me like ASP.NET pulls the referenced assemblies of the referenced assembly being added/referenced in the website.

Why does one need to add explicit references to the references of the references… ? Sorry if I'm not wording this correctly or if it confusing.

Best Answer

I think the problem may have to do with using a web site project, as oppossed to a Web Application. I can't remember off the top of my head, but there's something funky about the way web site projects are compiled, as oppossed to web application projects.