This solution worked for me: remove PostBuildEvent in the csproj file then recreate the script in Visual Studio.