The solution for several peopel was to add a small delay before copying the file ( Sleep(250);) to make sure the compiler and/or you program doesn't use the dll anymore.
Weird bug with live code editing
Hot reloading problem sfml
When posting code, please use the code tags so the code is easier to read.