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 .sln file to add an AfterBuild step.
  • Restart Unity.
  • Observe that the .sln file reverts to its previous state, losing the AfterBuild step.

 

I want to copy the DLL and PDB files to a custom folder whenever the code is rebuilt. How can I achieve this?

 

 

0
1 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.

 

0

Please sign in to leave a comment.