user1883004
user1883004

Reputation: 427

Visual Studio Post Build copy command error MSB3073 exit code 1

So I have C++ Player project which has 2 other project dependencies, both of which have post build events to copy the dll to another folder. The project was building, then it decided not to work randomly, and since then I have not found a solution. Even with a clean checkout from SVN, it still does not work, it works for all the other devs, apart from me.

I have checked the paths in the error messages, they do exist and as does the target dll.

Post-Build Event in each dependant project:

copy $(TargetPath) $(ProjectDir)..\..\$(Configuration)\plugins\$(ProjectName).dll

The resulting error:

error MSB3073: The command "copy C:\CMDev\CM2\Client\Apps\SSEP\Player\ACRP\CIAP\Debug\CIAP.dll C:\CMDev\CM2\Client\Apps\SSEP\Player\ACRP\CIAP....\Debug\plugins\CIAP.dll:VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 131 5

Current setup:

What have I tried:

What else can I try?

Upvotes: 7

Views: 28321

Answers (2)

CJBS
CJBS

Reputation: 15685

When double-clicking on the compiler error, I was brought to the same file (microsoft.CppCommon.target). However, this file is installed as part of the Visual Studio installation, was not writable for save (due to its permissions), and thus seemed to be a red-herring. The content of the file was the same as that in @user1883004's answer.

With a source control system, I did the following:

  1. Close Visual Studio
  2. Delete all files from the project root, and forcibly re-download from source control
  3. Open Visual Studio, and re-compile.

Without a source control system, try this variation of steps:-

  1. Close Visual Studio
  2. Manually delete the Debug/Release (or any other generated sub-directory)
  3. Open Visual Studio, and re-compile.

Note that neither Clean Solution nor Rebuild Solution worked for me.

Upvotes: 1

user1883004
user1883004

Reputation: 427

The problem was how VS was appending the :VCEnd suffix. Somehow the microsoft.CppCommon.targets file was modified incorrectly.

  <PropertyGroup>
      <_BuildSuffix>
:VCEnd</_BuildSuffix>
  </PropertyGroup>

Upvotes: 3

Related Questions