Visual Studio post-build event macros are empty

I had the same problem. According to https://social.msdn.microsoft.com/Forums/vstudio/en-US/179716e8-89eb-40ff-ba13-339e2d25d1c8/outdir-and-targetpath-macros-are-empty?forum=msbuild, you have to delete the PropertyGroup in the csproj file, and then to add the build event in Visual Studio again. enter image description here

After you add it again, it will be at the end of the csproj file, and the macros should work.


Try $(Configuration) instead of $(ConfigurationMode), I was having this issue too and this solved it, although I don't know why it happens...