Common Macros for Build Commands and Properties
说明
$(ProjectDir) The directory of the project (defined as drive + path); includes the trailing backslash '\'.
$(SolutionDir) The directory of the solution (defined as drive + path); includes the trailing backslash '\'.
$(TargetDir) The directory of the primary output file for the build (defined as drive + path); includes the trailing backslash '\'.
example
https://stackoverflow.com/questions/6267788/making-pre-and-post-build-event-scripts-pretty
考虑用powershell脚本接收参数,然后打印出来确认
在项目属性中,找到Build Events
然后点击Edit Post-build,点击Macros就可以看到对应到的具体的变量的Value
如何去掉backslash
https://stackoverflow.com/questions/36975106/how-can-i-remove-tralling-backslash-from-projectdir
You can use the TrimEnd function to trim the trailing slash character
$(ProjectDir.TrimEnd('\'))
I found this option in this post