Hi Aderson,
I found the cause of the build problem I think.
It seems that just having a particular directory open in Windows Explorer can lock the files displayed:
Error 6 Unable to delete file "C:\inetpub\wwwroot\dnn8\Website\DesktopModules\FlexiContent\Resources.Zip". The process cannot access the file 'C:\inetpub\wwwroot\dnn8\Website\DesktopModules\FlexiContent\Resources.Zip' because it is being used by another process. C:\inetpub\wwwroot\dnn8\Website\DesktopModules\FlexiContent\BuildScripts\ModulePackage.Targets
In my case, I can cause the build to fail by having the zip files from a previous build displayed in Windows Explorer.
The build fails the first time and gives the file locked error above. But since the build failed, a couple of temporary directories (package and ResourcesZip) which the build creates are not deleted.
These temporary directories are included in the next build causing it to fail with the illegal characters error.
Deleting the temporary directories and closing windows explorer allows the build to run successfully.
So the solution is not to have Windows Explorer open showing the files that the build creates. Though I wonder why Windows Explorer locks the files in the first place.
Another part of the solution would be to delete the temporary directories at the beginning of the build script. If the build did fail it could recover once Windows Explorer's lock is removed.
Though I still can't understand the compilation was successful on your environment because the temporary directories would have been present. But I think I'm getting closer :-)
Steve