locked
Best way to access domain objects across zones RRS feed

  • Question

  • User1001065250 posted

    I am working on a project that requires 2 applications an intranet website/webapi, and an external facing site that accesses data via the webapi. I am curious about best approach to share domain objects (example would be a user class) across these zones. If I create them in a class library which I reference in both projects, would this create any problems during deployment or would the class library compile into both projects? Does anyone have any suggestions about how to handle this?

    Thursday, January 9, 2020 6:29 PM

Answers

  • User475983607 posted

    mrburnttoast79

    When I build and deploy my projects does the shared code automatically get compiled with each project? 

    Depends on how your solutions/projects are setup.  If you have one solution with many projects then Visual Studio will copy the library DLL to the projects that reference the library.  If you have separate solutions that share a library then it's up to you manage the DLL versions.  It could be as simple as writing xcopy command to copy a DLL when the project is built or deployed. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 9, 2020 9:26 PM

All replies

  • User475983607 posted

    The common approach is to place shared code in a library.

    Thursday, January 9, 2020 8:30 PM
  • User1001065250 posted

    The common approach is to place shared code in a library.

    When I build and deploy my projects does the shared code automatically get compiled with each project? 

    Thursday, January 9, 2020 9:12 PM
  • User475983607 posted

    mrburnttoast79

    When I build and deploy my projects does the shared code automatically get compiled with each project? 

    Depends on how your solutions/projects are setup.  If you have one solution with many projects then Visual Studio will copy the library DLL to the projects that reference the library.  If you have separate solutions that share a library then it's up to you manage the DLL versions.  It could be as simple as writing xcopy command to copy a DLL when the project is built or deployed. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 9, 2020 9:26 PM
  • User1001065250 posted

    That's interesting. I had started this project as 3 separate solutions (internal, proxy and external) but it may be more manageable to place them all under 1 solution. Can separate publish packages be created for each web project in a single solution?

    Thursday, January 9, 2020 9:45 PM
  • User475983607 posted

    That's interesting. I had started this project as 3 separate solutions (internal, proxy and external) but it may be more manageable to place them all under 1 solution. Can separate publish packages be created for each web project in a single solution?

    Yes projects are deployed not solutions.

    Thursday, January 9, 2020 9:46 PM