3

I am getting the following error while doing some post build operations from Visual Studio 2015.

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(4291,5): error MSB3073: The command 'if 'Release'=='Release' (

...

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(4291,5): error MSB3073: )' exited with code 9009. -- FAILED"

What could be the issue here? I tried the following 'Post Build' event script:

<PostBuildEvent>if "$(ConfigurationName)"=="Release" (
      ...
)</PostBuildEvent>

I have also tried the following (without the quotes):

<PostBuildEvent>if $(ConfigurationName)==Release (
      ...
)</PostBuildEvent>

One important note: The issue is happening only on few projects within the same solution, whereas the others are working fine. No difference that I have noticed yet in the code.

  • Adding below line facing error or inside release condition, you written any code , it throw an error ? if $(ConfigurationName)==Release ( ... ) – Vinoth Rajendran Nov 08 '16 at 05:45
  • Hi Vinoth, I have just executed the above too. Same result and here's the output: >C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command "if Release==Release ( )" exited with code 255. – Kunal Chowdhury Nov 08 '16 at 06:11
  • You are asking a question with the wrong error code. MSB3073 is returned when a custom build step had thrown an error. code 9009 is the one you're looking at. See here http://stackoverflow.com/questions/1351830/what-does-exited-with-code-9009-mean-during-this-build. The error is coming from what you aren't showing in the three dots. Also, yes , the one with quotes is the right syntax, the other is wrong – Biepbot Von Stirling Apr 13 '17 at 09:58

1 Answers1

1

To Solve the error Error MSB3073

first of all change the solution mode to "Min-Release-dependency" then right click on the project in the solutions explorer

Properties ==> Custom Build Setup==> General ==> Command line : choose inherit from parent and then click on apply and OK, then rebuild the solution.

it should build with no errors.