MSbuild build order issue - pre-build steps first or dependent projects first

前端 未结 4 1941
日久生厌
日久生厌 2021-02-07 13:42

I have a project A depending on project B. Project A has some pre-build tasks that is dependent of some generated files from project B. When I build in Visual Studio, no probl

4条回答
  •  闹比i
    闹比i (楼主)
    2021-02-07 14:40

    This may be old but I recently ran into the same problem. Jack's answer was what I was trying to use but the ResolveReferences target is called when loading the projects in visual studio and this was bad for me because I was doing a fairly long process during my target that I only wanted to do before the build.

    The solution I ended up using was similar to VeeTheSecond but a bit less involved:

    
        ... exec something using a dependant project's output exe ...
    
    

    This would force the BeforeBuild target to wait until all dependant projects are actually done building so the exec command can use the dependant project's output.

提交回复
热议问题