Question

I have a 3-tier .NET 2.0 app. The presentation layer references the middle tier. The middle tier references the database layer. For some reason, when I compile, the dll's for the data layer appear in the bin of the presentation layer. How do I stop this?

Was it helpful?

Solution

The only way to stop this is to make one or more of your tiers a service-layer (or something similar) to physically separate your tiers.

Since your separate tiers were compiled against each other the assemblies need to be there for the entire application to function properly. How do you envision the application working without all the assemblies?

OTHER TIPS

set Copy Local to false in Reference properties

It is OK to be copied because there are known as Dependencies. Your Middle tier depends on DataAccess and UI on Middle tier. You have to keep track only not to reference data access from UI.

Normally I do physical layer application as following:

  1. UI
  2. Presenter
  3. BusinessLogic
  4. DataAccess
  5. Entity

But I'm changing my view on this organization. As I have done lot of projects and some of them demands maintenance and improvements. I start to think that this organization is too monolithic. Some authors like Ted Faison, Tomas Erl, Robert C. Martin, Andy Aunt says that this hierarchal approach is kind of naive.

Anyway... Put your logic in separated projects and build them as distincted assemblies. Make hierarchal references and you'll have what you want.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top