'MSB3073 exited with code 1

Error 102 error MSB3073: The command "copy C:\Users\Bike Simulation\Desktop\testing_dll\DrivingSimulator_DLL\example\DrivingSimulatorTextClient....\bin\VS2010\Win32\DrivingSimulatorProxy.dll C:\Users\Bike Simulation\Desktop\testing_dll\DrivingSimulator_DLL\example\DrivingSimulatorTextClient\bin\VS2010\Win32\Release\ :VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 132 5 DrivingSimulatorTextClient

I have seen the forums for the MSB3073 error, but i am unable to fix the problem on my code.
It works on a another system, but when I try to run the code on my new PC, it pops this error.

The code project is built on a sample project given by the software developer.

<Target Name="PostBuildEvent" Condition="'$(PostBuildEventUseInBuild)'!='false'">
<Message Text="Description: %(PostBuildEvent.Message)" Condition="'%(PostBuildEvent.Message)' != '' and '%(PostBuildEvent.Command)' != ''"/>
<Exec Command="%(PostBuildEvent.Command)$(_BuildSuffix)" Condition="'%(PostBuildEvent.Command)' != ''"/>

I get directed to this line on the Microsoft.CppCommon.targets



Solution 1:[1]

Based on your comment, my solution of move solution folder to C disk fixes that issue.

Solution 2:[2]

I was getting the same error using Visual Studio 2017. The compiler was unable to copy a dll to a folder. Later Found that the directory is ReadOnly. Unchecking the ReadOnly option and re-building the project helped me. Hope this helps anyone.

Solution 3:[3]

Same problem happened to me with Visual Studio 2017. Solution was on C drive, unchecking ReadOnly flag didn't solve the issue. What helped was to run Visual Studio as an Administrator.

When you run as Administrator you will see this in the corner of Visual Studio: enter image description here

Solution 4:[4]

This is an old question but I figured that I'll answer anyway, since I had the same problem.

The root cause of the error in this case is that there is a space (" ") in the directory or file name (in this case: "Bike Simulation").

Hence, the command "copy" is unable to process its parameters correctly. Easiest way to fix this is to rename the directories.

Solution 5:[5]

I was getting the same error in both Visual Studio 2019 and 2022. The compiler failing with security error,PSSecurityException as UnauthorizedAccess error as shown below. enter image description here

Unblock the file and re-building the project helped me. Hope this helps anyone.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jess
Solution 2 Jess
Solution 3 Jess
Solution 4 SVI-328
Solution 5 Krishna Nekkala