MSBuild: Platform Defining Issues for Child Builds

Is it possible to specify the target platform (x64, x86) when creating a project?

I have a build task that looks like this:

<MSBuild Projects="%(AgentProjectFiles.FullPath)" Properties="Architecture=x86;Configuration=$(Configuration);Optimize=$(Optimize);Platform=$(Platform);OutputPath=$(OutputDirectory)\Agent\;ReferencePath=$(ReferencePath);DebugSymbols=$(DebugSymbols);DebugType=none;" /> 

As you can probably tell, I have chosen everything possible that I saw online in the Properties attribute in the hope that it will work. You will notice that for the Architecture property, I set it as x86 explicitly. $ (Platform) is also installed on x86. I tried several permutations without success.

Unfortunately, it seems that no matter what falls into these properties, my class libraries are x86, but my executables are x64.

I thought that maybe the problem might be that the assembly properties specified in the project file itself cause MSBuild to ignore the ones I pass from MSBuild, but after changing them to x86, I still have the same problem.

Any ideas?

+3
source share
1 answer

In the AgentProjectFiles element declaration, you define the metadata of the Property . It looks like this:

 <ItemGroup> <AgentProjectFiles Include="something.proj"> <Properties>SOME VALUES HERE</Properties> </AgentProjectFiles> </ItemGroup> 

If you determine that the properties passed to the Properties attribute of the MSBuild task are ignored. I wrote about this MSBuild: Properties and additional properties Known metadata .

Said Ibrahim Hashimi

My book: Inside Microsoft Build Engine: Using MSBuild and Team Foundation Build

+3
source

All Articles