Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Website's BIN directory and references

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.

like image 942
user47460 Avatar asked Dec 13 '25 22:12

user47460


2 Answers

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.

like image 137
Nathan Prather Avatar answered Dec 15 '25 17:12

Nathan Prather


Here is a good article on your question Compilation and Deployment.

It has something to do with "WebSites" being compile at runtime. Hopefully the above article will answer your question.

like image 27
Chuck Conway Avatar answered Dec 15 '25 17:12

Chuck Conway



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!