2

I know this question was discussed hundreds of times, but I still cannot find solution. Maybe something was changed in msbuild and I am not aware. The problem is that I get the following warning

warning MSB8012: TargetPath(d:\src\output\Techd.dll) does not match the Linker's OutputFile 
property value (d:\src\output\Debug32\bin\Techd.dll). This may cause your project to build 
incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and
$(TargetExt) property values match the value specified in %(Link.OutputFile).

I change the outdir by property

msbuild.wxw /p:OutDir="my_out_dir"

I cannot change projects properties and I am not allowed to modify msbuild target files (Microsoft.CppBuild.targets). So don't have any idea hot to force msbuild to ignore this warning or to ignore the $OutDir variable's change.

Gayane
  • 627
  • 1
  • 11
  • 23
  • Possible answer : [here](http://stackoverflow.com/questions/16876429/how-do-i-fix-warning-msb8012-in-a-static-library-project-in-visual-c-2010) – Troopers May 10 '17 at 15:28

1 Answers1

5

You should be able to silence MSBuild warnings using a command line parameter:

msbuild.exe /nowarn:MSB8012

In an upcoming update to MSBuild/VS2017 (15.3), you can specify properties to control MSBuild warnings in project files as a property, so that it also affects builds in VS:

<MSBuildWarningsAsMessages>MSB8012</MSBuildWarningsAsMessages>
Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217