# Build creates alway 32 bit assembly

**URL:** https://www.finalbuilder.com/forums/t/build-creates-alway-32-bit-assembly/5473
**Category:** Discussion
**Created:** [April 13, 2016, 9:26am UTC](https://www.finalbuilder.com/forums/t/build-creates-alway-32-bit-assembly/5473 "2016-04-13T09:26:51Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![haggy](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@haggy](https://www.finalbuilder.com/forums/u/haggy)
#### Post date: [April 13, 2016, 9:26am UTC](https://www.finalbuilder.com/forums/t/build-creates-alway-32-bit-assembly/5473/1 "2016-04-13T09:26:51Z")

</div>

I ve one build which worked fine for monthes.  
  
Now it creates in a project always a 32 bit (x86) executeable instead of any cpu . It is a .net 4.6.1 console application and as a result I get bad images exception when it try to load a assembly which is 64 bit compiled  
  
  
Core Flags returns:  
  
Version: 4.0.30319  
CLR Header: 2.5  
Corlags 0x20003 //Should be 0x1 for any cpui, shouldn’t it?  
ILONLY: 1  
32 bit req: 0  
32 bitpref :1  
signed : 0  
  
To day i installed the latest updates ( including the .net security update) not sure wether this is realted to it.  
  
the project definition says for all build types any cpu  
the project thjen deploys with octodeploy. but this worked for monthes without problem  
  
  
How can I define the build type in the msbuild action ? I attacedh you some screen shots in the screens.zip showing the build steps  
[\_\_37319\_\_0\_\_screens.zip](https://www.finalbuilder.com/forums/uploads/default/original/2X/4/4ce059c5278297b9b84680cb2750c68d56de3a83.zip) (40.579 KB)

---

<div class="post-metadata">

### Author: ![haggy](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@haggy](https://www.finalbuilder.com/forums/u/haggy)
#### Post date: [April 13, 2016, 9:37am UTC](https://www.finalbuilder.com/forums/t/build-creates-alway-32-bit-assembly/5473/2 "2016-04-13T09:37:01Z")

</div>

I Also tried to add   
  
  
 Platform=“Any CPU”   
 to the properties tab but still same problem…   
  
  
 the log output for this project is:   
  
 Working Directory: D:\Continua\Agent\Ws\38112\Source\Web\src\SR.BusPortal.WebApi\SR.BusPortal.Worker   
 Executable: C:\Program Files (x86)\MSBuild\14.0\bin\amd64\MSBuild.exe   
 Arguments: /nologo /verbosity:normal “build” RunCodeAnalysis=false Platform=“Any CPU” outputpath=“D:\Continua\Agent\Ws\38112\Output” configuration=“Production” /noconsolelogger /nodeReuse:False /logger

---

<div class="post-metadata">

### Author: ![haggy](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@haggy](https://www.finalbuilder.com/forums/u/haggy)
#### Post date: [April 13, 2016, 9:50am UTC](https://www.finalbuilder.com/forums/t/build-creates-alway-32-bit-assembly/5473/3 "2016-04-13T09:50:01Z")

</div>

one more thing i checked old verisons which were build they all have   
  
 32BITPREF : 0

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [April 14, 2016, 2:46am UTC](https://www.finalbuilder.com/forums/t/build-creates-alway-32-bit-assembly/5473/4 "2016-04-14T02:46:27Z")

</div>

Hi Haggy   
  
 It’s unlikely that a security update would have broken this, but then I have seen stranger things.   
  
 What are you setting the BuildMode variable to? This is used to specify your configuration. I notice you are building the csproj file rather than the sln, in this case you probably need to set the MSBuild property (on the properties tab of the msbuild action) :   
  
 Platform=“Any CPU”   
  
 When you build a solution, this is often part of the configuration name, or msbuild gets it from the solution configuration, when you build a csproj file you need to set it yourself.

---

<div class="post-metadata">

### Author: ![haggy](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@haggy](https://www.finalbuilder.com/forums/u/haggy)
#### Post date: [April 14, 2016, 8:44am UTC](https://www.finalbuilder.com/forums/t/build-creates-alway-32-bit-assembly/5473/5 "2016-04-14T08:44:47Z")

</div>

Hi Vincent .   
  
 I tried both.   
  
 The buildmode is one that is set tu anycpu and the prefer 32 bit option off. I checked this via the vs ui and in the csproj. file it self.   
 When I locally build the project with this mode   
  
  
  
 bin\Production\</OutputPath\>   
 TRACE;CODE\_ANALYSIS;PRODUCTION   
 true   
 3016   
 pdbonly   
 AnyCPU   
 true   
 prompt   
 …\SD\_RuleSet.ruleset   
 false   
  
  
  
 value of the Buildmode Property is “Production”   
  
  
 here a more detailed log.   
  
  
 Working Directory: D:\Continua\Agent\Ws\38178\Source\Web\src\SR.BusPortal.WebApi\SR.BusPortal.Worker   
 Executable: C:\Program Files (x86)\MSBuild\14.0\bin\amd64\MSBuild.exe   
 Arguments: /nologo /verbosity:diagnostic “build” RunCodeAnalysis=false Platform=“Any CPU” outputpath=“D:\Continua\Agent\Ws\38178\Output” configuration=“Production” /noconsolelogger /nodeReuse:False /logger:ParallelLogger,“C:\Program Files\VSoft Technologies\ContinuaCI Agent\Continua.Modules.Builds.MSBuild.v40.dll” D:\Continua\Agent\Ws\38178\Source\Web\src\SR.BusPortal.WebApi\SR.BusPortal.Worker\SR.BusPortal.Worker.csproj   
 Environment Variables   
 RunOctoPack: true   
 OctoPackPublishPackageToHttp: [http://srv04.green-parrot.net:8080/nuget/packages](http://srv04.green-parrot.net:8080/nuget/packages)   
 OctoPackPublishApiKey: API-TOY3UMCH6KDA0STBL3OXB0K5RY0   
 OctoPackPackageVersion: 1.0.0.53   
 OctoPackEnforceAddingFiles: true   
 C:\Program Files (x86)\MSBuild\14.0\bin\amd64\MSBuild.exe /noconsolelogger /nologo /logger:ParallelLogger,C:\Program Files\VSoft Technologies\ContinuaCI Agent\Continua.Modules.Builds.MSBuild.v40.dll /nodeReuse:False /P:configuration=Production /target:build /verbosity:diagnostic D:\Continua\Agent\Ws\38178\Source\Web\src\SR.BusPortal.WebApi\SR.BusPortal.Worker\SR.BusPortal.Worker.csproj   
 Build started 13.04.2016 21:26:46.   
 Overriding target “GetFrameworkPaths” in project “C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets” with target “GetFrameworkPaths” from project “C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.NetFramework.CurrentVersion.targets”.   
 Overriding target “SatelliteDllsProjectOutputGroup” in project “C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets” with target “SatelliteDllsProjectOutputGroup” from project “C:\Windows\[Microsoft.NET](http://Microsoft.NET)\Framework64\v4.0.30319\Microsoft.WinFx.targets”.   
 The target “BeforeGenerateProjectPriFile” listed in a BeforeTargets attribute at “C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (186,61)” does not exist in the project, and will be ignored.   
 Project “D:\Continua\Agent\Ws\38178\Source\Web\src\SR.BusPortal.WebApi\SR.BusPortal.Worker\SR.BusPortal.Worker.csproj” on node 1 (build target(s)).   
 Overriding target “GetFrameworkPaths” in project “C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets” with target “GetFrameworkPaths” from project “C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.NetFramework.CurrentVersion.targets”.   
 Overriding target “SatelliteDllsProjectOutputGroup” in project “C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets” with target “SatelliteDllsProjectOutputGroup” from project “C:\Windows\[Microsoft.NET](http://Microsoft.NET)\Framework64\v4.0.30319\Microsoft.WinFx.targets”.   
 The target “BeforeGenerateProjectPriFile” listed in a BeforeTargets attribute at “C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (186,61)” does not exist in the project, and will be ignored.   
 Overriding target “GetFrameworkPaths” in project “C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets” with target “GetFrameworkPaths” from project “C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.NetFramework.CurrentVersion.targets”.   
 Overriding target “SatelliteDllsProjectOutputGroup” in project “C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets” with target “SatelliteDllsProjectOutputGroup” from project “C:\Windows\[Microsoft.NET](http://Microsoft.NET)\Framework64\v4.0.30319\Microsoft.WinFx.targets”.   
 The target “BeforeGenerateProjectPriFile” listed in a BeforeTargets attribute at “C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (186,61)” does not exist in the project, and will be ignored.   
 Deferred Messages

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [April 15, 2016, 2:52am UTC](https://www.finalbuilder.com/forums/t/build-creates-alway-32-bit-assembly/5473/6 "2016-04-15T02:52:32Z")

</div>

Hi Haggy,  
  
Set the Platform property as&nbsp;Platform=AnyCPU instead of Platform=“Any CPU” .&nbsp;  
  
This should solve your problem. The odd thing however, is that we get the correct output in our tests with your project PropertyGroup settings and without the Platform property set in the action at all.   
  
Can you send the full .csproj project file to support@finalbuilder and also let us know the MDBuild version number, e.g.&nbsp;“C:\Program Files (x86)\MSBuild\14.0\bin\amd64\MSBuild.exe” /version, so we can investigate further?

---

<div class="post-metadata">

### Author: ![haggy](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@haggy](https://www.finalbuilder.com/forums/u/haggy)
#### Post date: [April 18, 2016, 7:54am UTC](https://www.finalbuilder.com/forums/t/build-creates-alway-32-bit-assembly/5473/7 "2016-04-18T07:54:58Z")

</div>

I sent you the project file   
  
 The resolved version of   
 “C:\Program Files (x86)\MSBuild\14.0\bin\amd64\MSBuild.exe” /version   
  
 Was: 14.0.25123.0

---

<div class="post-metadata">

### Author: ![haggy](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/h/edb3f5/32.png) [@haggy](https://www.finalbuilder.com/forums/u/haggy)
#### Post date: [April 18, 2016, 8:16am UTC](https://www.finalbuilder.com/forums/t/build-creates-alway-32-bit-assembly/5473/8 "2016-04-18T08:16:35Z")

</div>

I tried now building with that any cpu setting and still some problem it is marked as prefer 32 bit
