How do I fix MSB3073 error in my post-build event?

后端 未结 14 2563
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-05 04:48

I\'m working on a project that requires that DLLs generated by building my solution to be copied from the bin folder to another folder, both of which are on my machine, in m

相关标签:
14条回答
  • 2020-12-05 05:06

    Playing around with different project properties, I found that the project build order was the problem. The project that generated the files I wanted to copy was built second, but the project that was running the batch file as a post-build event was built first, so I simply attached the build event to the second project instead, and it works just fine. Thanks for your help, everyone, though.

    0 讨论(0)
  • 2020-12-05 05:07

    Following thing you should do before to run copy command if you facing some issue with copy command

    1. open solution as a administrator and build the solution.
    2. if you have problem like "0 File(s) copied" check you source and destination path. might you are using wrong path. it would be better if you run the same command in "command prompt" to check whether it is working fine or not.
    0 讨论(0)
  • 2020-12-05 05:07

    I solved it by doing the following:

    In Visual studio I went in Project -> Project Dependencies

    I selected the XXX.Test solution and told it that it also depends on the XXX solution to make the post-build events in the XXX.Test solution not generate this error (exit with code 4).

    0 讨论(0)
  • 2020-12-05 05:10

    The Post-Build Event (under Build Events, in the properties dialog) of an imported project, had an environment variable which was not defined.
    Navigated to Control Panel\All Control Panel Items\System\Advanced system settings to add the appropriate environment variable, and doing no more than restarting VS2017 resolved the error.
    Also, following on from @Seans and other answers regarding multiple project races/contentions, create a temp folder in the output folder like so,

    and select the project producing the preferred output:

    and build (no rebuild/clean) is a speedy solution.

    0 讨论(0)
  • 2020-12-05 05:13

    I was getting this error after downloading some source code from Github. Specifically the rust oxide development framework. My problem is that the Steam.ps1 script file, that's used to update some of the dlls from Steam was blocked by the OS. I had to open the files properties an UNBLOCK it. I had not realized this was done to ps1 files as well as exes.

    0 讨论(0)
  • 2020-12-05 05:14

    If the problem still persists even after putting the after build in the correct project try using "copy" instead of xcopy. This worked for me.

    0 讨论(0)
提交回复
热议问题