locked
Is there a way to separate App_Code into separate assemblies for deployment? RRS feed

  • Question

  • User-1705917722 posted

    I'm using a layered approach where under my App_Code directory I have subdirectories for BLL, DAL, etc.  But I haven't been able to figure out how to separate these classes in these subdirectories into separate assemblies.  Instead, no matter what configuration options in the Web Deployment Project I use, they all get grouped together into a single assembly (at most).

    Since updating the site will usually require updating specific web page(s), BLL classe(s), and DAL classe(s), it's important that these classes be separated out into, ideally, their own assemblies.  Is this possible?
     

    Tuesday, June 3, 2008 1:20 PM

Answers

  • User1564875471 posted

    yes, you just need to use the codeSubDirectories compilation  section in web.config ,

    example ,

    <compilation debug="true" strict="false">

    <codeSubDirectories>

    <add directoryName="DAL"/> <add directoryName="BLL"/>

    </codeSubDirectories>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 3, 2008 2:30 PM

All replies

  • User-125547262 posted

    Why  not create different class library projects say one for your DAL and one for your BLL and then add the reference to these projects in your website? This is how we do it 

    Tuesday, June 3, 2008 2:23 PM
  • User1564875471 posted

    yes, you just need to use the codeSubDirectories compilation  section in web.config ,

    example ,

    <compilation debug="true" strict="false">

    <codeSubDirectories>

    <add directoryName="DAL"/> <add directoryName="BLL"/>

    </codeSubDirectories>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 3, 2008 2:30 PM
  • User-1705917722 posted

    I could do that, and then I'd be able to update just the BLL, DAL, etc.....But usually a change, like say, adding a column to a database, would usually require modifying only 1 class/page in all 3 levels (Web, BLL, and DAL).  And depending on what other changes are being worked on, there may be other changes within the BLL or DAL source which we don't want to release yet. So, it'd be much easier to just make the change and deploy just the necessary files

    Otherwise there's a whole lot of coordination that needs to happen with the source....I'd have to grab a copy of the current released source (or rollback my source to the last release), make the change, and then recompile and re-deploy.  And then if another developer wanted to make a change, they'd have to do the same to make sure that when they deploy their change, it includes my change.  Meanwhile we're all working on changes yet to be released, a lot of which, depend on each other, so having to deploy whole BLL or DAL assemblies just creates a lot of headaches.

    I guess I'm just not getting why we are allowed to deploy each web page in its own assembly, but everything under App_Code is forced to be in a single assembly.
     


    Tuesday, June 3, 2008 2:46 PM
  • User-1705917722 posted

     Oooh...that looks promising anas.  I'll look into that.  Thanks.

    Tuesday, June 3, 2008 2:47 PM