title: dotnet publish commandline with platform parameter value of "Any CPU" for a .NET Core Web API Application
body: <p>We developed an a .NET Core Web API application using the following technologies:</p>
  
  <p>-NET Core (3.1)</p>
  
  <p>-Visual Studio 2019</p>
  
  <p>Unfortunately, we have to deploy said application to the following environment:</p>
  
  <p>-32-bit Environment</p>
  
  <p>-Windows Server 2008 R2 Enterprise (Service Pack 1)</p>
  
  <p>-IIS Version 7.5</p>
  
  <p>-8 GB RAM</p>
  
  <p>( Also, it needs to be an In-Process because we Only want the .NET Core Web API Application to be within IIS Server )*</p>
  
  <p>On my Development Computer that uses Visual Studio 2019, I installed Net Core 3.1 x86 sdk version ( i.e., the .NET Core 32-Bit version )</p>
  
  <p>Prior to Visual Studio 2019's Build, we have to specify Platform target: "Any CPU" because if we specified "x86" then when we deploy to our IIS Server x86 platform, it throws a weird 500 level error when we run the .NET Core Web API in IIS. </p>
  
  <p><a href="https://i.stack.imgur.com/vftJ5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vftJ5.jpg" alt="enter image description here"></a></p>
  
  <p>We are trying to use dotnet commandline to publish the .NET Core Web API application.</p>
  
  <blockquote>
    <p>D:\AppCodeArena\BlahBlahProject>dotnet publish -c Release
    /p:Platform:"Any CPU" /p:EnvironmentName=UAT BlahBlahProject.csproj
    --output D:\IISDeployment\Uploader.BlahBlahProject</p>
    
    <p>Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core
    Copyright (C) Microsoft Corporation. All rights reserved.</p>
    
    <p>MSBUILD : error MSB1006: Property is not valid. Switch: Platform:Any
    CPU</p>
  </blockquote>
  
  <p>Unfortunately, it states above that </p>
  
  <blockquote>
    <p>/p:Platform:"Any CPU"</p>
  </blockquote>
  
  <p>is invalid?  Could someone please post the correct dotnet publish... command that will allow use to specify "Any CPU" for the platform?</p>
  
  <p>Or 
  if there is anyway to use MSBuild commandline instead of 
  "dotnet publish" commandline then could someone please post how to do so?</p>