Changes to AfterBuild step in .sln file lost after Unity restart
When I add an AfterBuild step directly in the .sln file, the changes are lost after restarting Unity. It seems Unity regenerates the solution file and overwrites my modifications.
- Modify the
.slnfile to add anAfterBuildstep. - Restart Unity.
- Observe that the
.slnfile reverts to its previous state, losing theAfterBuildstep.
I want to copy the DLL and PDB files to a custom folder whenever the code is rebuilt. How can I achieve this?
Please sign in to leave a comment.
Zhoujiazhiwork, you can explore Unity's automation tooling described in Run custom scripts during the build process.
Alternatively, you can create a script that processes the files the way you want and add such script to Rider as an external tool as described in Add a local external tool. Once you add the tool, you can change your Run configuration by creating a new Before Launch task that launches your script.