Deploying MEF components with a web project that consumes them

My apologies if this has already been addressed, but I cannot find the answer anywhere.

I have an MVC4 web application that consumes MEF components. These components live in a different project under the same solution:

  • My decision
    • Web project
    • Dll Project defining MEF interfaces (which are all referenced)
    • Dll project containing a valid MEF class
    • Another Dll project containing a valid MEF class

The web project references a project that contains the MEF interfaces (# 2), but not projects that contain the actual MEF classes (# 3 and # 4), as this is the entire structure element. I have a post-build step on # 3 and # 4 that will copy the built assemblies to the bin folder of the web project and the web project is also marked as dependent on projects # 3 and # 4.

This works brilliantly on my machine, compiles and drag and drop Dlls, but when I really need to deploy this thing I need to take two steps: deploy the web project like any other and then manually copy the assemblies created by project # 3 and # 4 to the server. Since they are not referenced by the web project, they are not included in the web posting material.

I've looked into the Web Publish project options, and while I can apparently set it up to copy every little thing in the project folder, I can't set it to just copy certain supporting files. Is there a way to get around this besides adding hard links to builds # 3 and # 4 in the web project?

+3


source to share


1 answer


Have you tried to copy an assembly of MEF classes to the "_ bin_deployableAssemblies" folder on your website. It worked great for me



0


source







All Articles