'PostBuildEvent' failed with error code '1' 'Unspecified error' error

2.2k Views Asked by At

I have a postbuild .js script that I want to. I added this script in the setup folder. The build is giving the 'PostBuildEvent' failed with error code '1' 'Unspecified error' error. The script is cscript.exe "$(ProjectDir)ModifyMsiToEnableLaunchApplication.js" "$(BuiltOuputPath)" I am using .net c# 4.0. No links helped me to solve this.

1

There are 1 best solutions below

1
On

If you want to persist this file to the output directory, you may want to check the "Copy to Output Directory" property of the .js file object in the visual studio IDE is set to CopyAlways. That will copy it when the project is built.

Other than that, it could be a permissions issue. Have you tried running visual studio by right-clicking then running as admin? And then on the folder location where you have the .js files, try folder properties->security-> temporarily grant the user "everyone" (or whoever you are running VS under) read/write access to the folder where you post build script is.