Post-buld event error

Keyhoon Ko (고기훈) 1 Reputation point
2021-07-23T15:37:15.343+00:00

I have an error message when I put a command like "echo test2" in Post-build event command line as attached.
The command works in DOS command as shown 117494-post-build-error.jpg

Community Center Not monitored
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,436 Reputation points Microsoft External Staff
    2021-07-26T06:00:09.29+00:00

    Hi @Keyhoon Ko (고기훈) ,

    Welcome to Microsoft Q&A forum.

    Tested on my side, but failed to reproduce your issue, the echo test2 post-build event worked on my side.

    Generally, this command should work. I suggest you check these aspects:

    1). Rebuild your solution.

    2). Change the Run the post-build event from On successful build to Always and then rebuild your project.

    3). Please switch to check the Output window to see the detailed error message(Tools > Options > Projects and Solutions > Build And Run > MSBuild project build out verbosity: > Detailed/Diagnostic > OK).

    4). Perhaps this error is caused by specific development environment, if this issue is reproducible(by using a new project), please share the steps with me to reproduce your issue.

    Best Regards,
    Tianyu

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    0 comments No comments

  2. Keyhoon Ko (고기훈) 1 Reputation point
    2021-07-26T14:07:02.39+00:00

    Tianyu,
    Thank you for your quick response.

    I created a new win form application, and add post-bult with "Always" for Run the post-build event option as you recommended 2).
    I captured the Output window with your suggestion of 3).

    The highlighted Korean says
    "C:\Users\=====" is not an internal or external command, executable or batch file.

    However, I found my user path includes "(----)" as shown attached.

    117955-image.png

    117974-image.png


  3. Keyhoon Ko (고기훈) 1 Reputation point
    2021-07-30T16:26:54.683+00:00

    Tianyu,
    Thank you for your support.

    I tried VS repair, but it doesn't work.
    Please see the attached image which shows system environment variables.
    119446-image.png


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.