I'm using PostSharp alternative called AfterThought to postprocess some of projects in my solution. Unfortunately it looks like project's post-build event command line property isn't the right extension point where to plug the post-processor in, because the compiled assembly is copied to some of the dependent projects before post-build event is fired and postprocessor run. It's interesting that the problem occurss only for web site and web service projects - dependent class libraries got post-processed version of the assembly, but I guess the core of the problem is in the post-build event is invoked too late and that I should use different event.
So I guess I need to enhance the build process/MSBuild of my projects directly in *.csproj files - is that right? And what build event is the right one for invocation of command line assembly post-processor?
The final solution to my problem is CompileDependsOn target:
<Target Name="AfterThought">
<Exec Command=""$(SolutionDir)..\LIBS\Afterthought\Afterthought.Amender.exe" "@(IntermediateAssembly->'%(FullPath)')" "$(SolutionDir)..\Amendments\bin\$(Configuration)\Amendments.dll" @(ReferencePath->'"%(RootDir)%(Directory)."', ' ')" />
</Target>
<PropertyGroup>
<CompileDependsOn>
$(CompileDependsOn);
AfterThought;
</CompileDependsOn>
</PropertyGroup>