简体   繁体   中英

Visual Studio post build event returns error MSB3073

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM