I tried to make my .Net project to run a post-build script. This script is to trigger a NANT build. So, in the Build Events, I wrote the following line:
"%ProgramFiles%\Nant\bin\NAnt.exe" build -buildfile:"$(ProjectDir)assets.build"
exit 0
However, for some reason, the build开发者_C百科 works fine when I run the "nant build" directly in the command line. It pops errors when it runs in the post script. The problem is related to the paths. I am thinking to pass the Net macros into NANT build as a property through the command line. Something like:
"%ProgramFiles%\Nant\bin\NAnt.exe" build -buildfile:"$(ProjectDir)assets.build" -D:testpath="$(ProjectDir)"
It still is not working.
Any advice?
It probably has something to do with the "current" working directory.
Does the nant build script try to access any other files or external references, using relative paths for example?
If so, you may want to use the project::get-base-directory()
nant function to build your paths instead.
精彩评论