I have a C# project set up with another C# project in the solution as a project reference. When I build the solution on my build server with MSBuild parameters "/m /p:buildinparallel=true", the dependent project builds first, but it seems during the post-build event of the dependent project, the project that references it starts to build, and fails because it can't find the referenced assembly (because my post-build event modifies the referenced assembly in-place, and it isn't available during that processing).
I can see that the referencing project created its ProjName.csprojResolveAssemblyReference.cache file just before the referenced project's assembly is done being modified, and by that point, it has failed.
When I build the same solution on my build server with "/m:1 /p:buildinparallel=false", the build succeeds, although I don't think that's a good workaround because it hurts my performance and I'm not sure it gets at the root cause either.
Can I do something so MSBuild doesn't start the dependent project's build until after the dependent project's post-build event is done?
Using MSBuild 4.5.