I have a c# project and in the solution, the platform target is AnyCPU. While I have a build program that will daily build this solution and it uses msbuild.exe. The command likes:
MSBuild D:\my.sln /p:Configuration=Release /p:Platform=x86 /t:rebuild ....
Here I specify the compiled platform should be x86.
I my opinion, the msbuild.exe should overwrite solution configure and the output should be x86 exe instead of anyCPU type.
I try these codes into this project:
PortableExecutableKinds peKind;
ImageFileMachine machine;
Assembly.GetExecutingAssembly().ManifestModule.GetPEKind(out peKind, out machine);
The test result suggest, the exe is AnyCPU mode (ILOnly), not what expected. In such condition, how can i know my program it compiler by x86 or x64, by code?
Thanks. Li