Note that there are some explanatory texts on larger screens.

plurals
  1. POMSBuild copy output from another project into the output of the current project
    text
    copied!<p>I have a situation where I want to copy the output assembly from one project into the output directory of my target application using MSBuild, without hard-coding paths in my MSBuild Copy task. Here's the scenario:</p> <ul> <li>Project A - Web Application Project</li> <li>Project B - Dal Interface Project</li> <li>Project C - Dal Implementation Project</li> </ul> <p>There is a Business layer too, but has no relevance for the MSBuild problem I'm looking to solve.</p> <p>My business layer has a reference to my Dal.Interface project. My web project has a reference to the Business layer and as it stands, doing a build will pull the business layer and Dal.Interface projects into the output. So far, so good. Now in order for the web app to run, it needs the Dal implementation. I don't want the implementation referenced anywhere since I want to enforce coding to the interface and not having a reference means it won't show up in intellisense, etc.</p> <p>So I figured I could handle this through the MSBuild copy operation as an AfterBuild task (I have the Dal Implementation setup to build when the web project builds, just not referenced). I don't want to hard code paths or anything else in the MSBuild params, so I'm trying to figure out how to reference the output of the Dal project from the Web Application Project's MSBuild file.</p> <p>So based on the projects mentioned above this is what I want to see happen:</p> <ol> <li>Web app build is kicked off</li> <li>All required projects build (already configured, so this is done)</li> <li>MSBuild "AfterBuild" task kicks off and the output from Project C (Dal Implementation) is copied to the Bin directory of Project A (web app)</li> </ol> <p>Part 3 is where I'm stuck. </p> <p>I'm sure this can be done, I'm just not finding a good reference to help out. Thanks in advance for any help.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload