Im currently struggling with some weird behaviour. i am using the on-premise version of TFS vNext Build 2015 (or how it is correctly called...)
I have to build a solution which consists of several projects defined as "x86". But there are also projects defined as "any cpu" in this particular solution.
I have set up the "visual studio build" step with Platform Parameter as "x86".
If i look in the log file (with debug true) of this build step, i see build arguments getting passed to msbuild like that
2018-02-02T07:47:01.2435083Z ##[debug]Entering Get-VSPath.
2018-02-02T07:47:01.2435083Z ##[debug] Version: '14.0'
2018-02-02T07:47:01.2591339Z ##[debug]Leaving Get-VSPath.
2018-02-02T07:47:01.2591339Z ##[debug]Leaving Select-VSVersion.
2018-02-02T07:47:01.2747595Z ##[debug]Entering Select-MSBuildLocation.
2018-02-02T07:47:01.2747595Z ##[debug] VSVersion: '14.0'
2018-02-02T07:47:01.2747595Z ##[debug] Architecture: 'x86'
2018-02-02T07:47:01.2903853Z ##[debug]Entering Get-MSBuildPath.
2018-02-02T07:47:01.2903853Z ##[debug] Version: '14.0'
2018-02-02T07:47:01.2903853Z ##[debug] Architecture: 'x86'
2018-02-02T07:47:01.3997646Z ##[debug]MSBuild: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
2018-02-02T07:47:01.3997646Z ##[debug]Leaving Get-MSBuildPath.
2018-02-02T07:47:01.4153898Z ##[debug]Leaving Select-MSBuildLocation.
2018-02-02T07:47:01.4153898Z ##[debug]Entering Format-MSBuildArguments.
2018-02-02T07:47:01.4153898Z ##[debug] MSBuildArguments: ''
2018-02-02T07:47:01.4153898Z ##[debug] Platform: 'x86'
2018-02-02T07:47:01.4153898Z ##[debug] Configuration: 'release'
2018-02-02T07:47:01.4153898Z ##[debug] VSVersion: '14.0'
2018-02-02T07:47:01.4153898Z ##[debug]Leaving Format-MSBuildArguments.
2018-02-02T07:47:01.4310157Z ##[debug]Entering Invoke-BuildTools.
2018-02-02T07:47:01.4466410Z ##[debug] NuGetRestore: 'True'
2018-02-02T07:47:01.4466410Z ##[debug] MSBuildLocation: 'C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe'
2018-02-02T07:47:01.4466410Z ##[debug] MSBuildArguments: ' /p:platform="x86" /p:configuration="release" /p:VisualStudioVersion="14.0"'
after looking at this i would say, everything is setup correctly, to get those projects defined as "x86" compiled for "x86" architecture. But neither the assembly is created in bin\x86\release nor the architecture is "x86" of the created dll. I checked this with a little powershell script, which i found here
How to determine if a .NET assembly was built for x86 or x64?
Any one has any idea what may i have to check, why it won't compile with "x86" architecture? Do i have to setup something differently, because the solution configuration manager is giving me "Mixed Platforms" if i have a look in the solution.
If any further information is needed, feel free to ask for.
thanks in advance for any suggestions or hints.
UPDATE 07.02.2018
For those having the same problem, for me the whole problem was only a missunderstanding in how it works with those platform settings. In my case, there was already an existing configuration for "x86" which has setup every project except the main project as "any cpu". My fault has been, that i had looked in VS in Configuration Manager and had chosen "mixed platforms". I should have chosen "x86" in VS like i did in the build step.