Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to run a .NET Core project in 32-bit mode

Tags:

.net-core

How can you force dotnet to run a project in 32-bit mode on a Windows 10 64-bit machine? Both dotnet restore and the dotnet build support a --runtime switch, e.g.:

dotnet restore --runtime win-x86
dotnet build --runtime win-x86

The dotnet run sub-command however does not support a --runtime switch.

like image 690
sakra Avatar asked Jun 27 '17 09:06

sakra


People also ask

How do I change my Visual Studio from 32 bit to 64 bit?

From the BUILD menu in Visual Studio, select Configuration Manager. From the Active solution platform drop-down list, select New. The New Solution Platform dialog displays. In the Type or select new platform combination box, select x64.

Is .NET core 64 bit?

NET Core SDK and runtimes. In almost all cases the right version of the SDK to download and is the 64 bit version unless you are running on 32 bit Windows version (hopefully not).


2 Answers

dotnet run does not have --runtime/-r support but dont give up bro, there is a hope!

If you want only run in 32 bit you can easly use for example dotnet your_app.dll after build to 32 bit (by publish or build). dotnet run command running application from the source code

If you want force x86 in VS go to the Properties > Build and change Platform target from Any CPU to x86

like image 187
J. Doe Avatar answered Oct 21 '22 06:10

J. Doe


There is a runtime option for dotnet run now.

To execute as x86:

dotnet run -r win-x86

like image 40
sipsorcery Avatar answered Oct 21 '22 04:10

sipsorcery