Search code examples
.net.net-corebuild64-bit

How to ask dotnet build command to produce 64 bit artifacts


We have a .Net core 3.1 based web application and we use dotnet build command to generate build files in CI/CD pipeline. Below is how our build command looks like -

dotnet build MySolution.sln -m:1  -f=netcoreapp3.1 --nologo -c Release -p Platform=x64

The issue is the last part in this command doesnt work - -p Platform=x64 We get below error -

MSBUILD : error MSB1005: Specify a property and its value.
Switch: -p

We looked at the build command documentation but didnt get any way to create 64 bit artifacts. Is there any way to specify different platforms (x86 vs x64) to dotnet build command? Please help!


Solution

  • to specify the platform use format like in msbuild cli for e.g.:

    dotnet build MySolution.sln --nologo -c Release /p:Platform=x64