2

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.

Samer Adra
  • 683
  • 7
  • 16
  • The post build event code is required to get an answer – KMoraz Apr 18 '13 at 21:03
  • Post-build event calls Dotfuscator to obfuscate the output dll. The problem is the next project starts building while this is in progress. "C:\Program Files (x86)\PreEmptive Solutions\Dotfuscator Professional Edition 4.9\dotfuscator.exe" /v config.xml – Samer Adra Apr 18 '13 at 21:18
  • 3
    Use [AfterCompile\AfterBuild](http://stackoverflow.com/a/5927512/147211) target instead of post build event. – KMoraz Apr 18 '13 at 21:38

0 Answers0