1

I've created some bastardized Onion Architectures which I need to fix. Specifically, my dependency resolution stuff is referenced in my UI layer (MVC). I need to pull those out into their own WebActivator assembly as I see recommended everywhere, but I am hitting one big wall and can't find an explanation on how to get around it.

Our build process actually builds a web package to deploy to the server via xcopy for all intents and purposes. This runs the web.config transforms, only includes project files, etc., so we can be sure of what is going over.

But when the MVC site doesn't HAVE a reference to the DI project, how do I make it copy over during this process? Ideally, I'd like to avoid having to add a section to my PSake build script to just copy this DLL over after building the projects, but I'm unsure what my best bet is here.

Michael Hallock
  • 1,413
  • 1
  • 11
  • 17
  • I don't see why you should extract "dependency resolution stuff" into "their own ... assembly". It's quite common to have your composition root inside your web application (and it makes everything so much easier). Look at this related question: http://stackoverflow.com/questions/9501604/ioc-di-why-do-i-have-to-reference-all-layers-assemblies-in-entry-application – Steven Jul 23 '13 at 08:27
  • 1
    what about http://stackoverflow.com/questions/2747081/how-do-you-include-additional-files-using-vs2010-web-deployment-packages ? – Cybermaxs Aug 13 '13 at 12:02
  • In the end I agreed with Steven on this. I was conforming to an architecture for the purpose of conforming to an architecture. There was no reason for me to abstract the IoC into it's own layer, and it was causing too many issues. – Michael Hallock Dec 19 '13 at 18:58

1 Answers1

0

I usually add a post build event on the data project with something like this

xcopy /y "$(TargetDir)*.*" "$(SolutionDir)YourProject.Website\bin\"
ericdc
  • 11,217
  • 4
  • 26
  • 34