Delete currently loaded assembly
问题 In my application comes with an uninstaller. Everything is working fine, except that I can't find no way to delete the uninstaller.exe file when it's all done. I tried to copy the current assembly exe into a temp directory, but the file-handle of the original file is still locked. Any ideas? 回答1: You will need to PInvoke to do this. MoveFileEx has the ability to schedule deleting the file on next reboot. If dwFlags specifies MOVEFILE_DELAY_UNTIL_REBOOT and lpNewFileName is NULL, MoveFileEx