I have a vs2015 solution containing an asp.net core project and have configured its project.json as follow :
{
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true,
"platform": "x86"
},
"runtimes": {
"win10-x86": {}
},
"frameworks": {
"net461": {}
},
"commands": {
"web": "Microsoft.AspNet.Hosting --ASPNET_ENV production --server Microsoft.AspNet.Server.Kestrel --server.urls http://+:12345",
}
[...]
}
I am expecting the application to build and run with the platform specified in project.json ( FYI, I am running the app via vs2015 debugger on a win10/x64 box ). However, win7-x64 runtime is used instead. I can see a win7-x64 output directory and the prompt title launched indicates it too.
If I build and run directly via command line specifying the runtime, it works.
So my question is, what else do I need to configure to start the asp.net core app in x86 from vs2015 ?
There are 2 options:
Victor Hurdugaci's answer should be upvoted, this here just provides some more information in case you need it.
There seems to be a tooling issue at the moment when you have installed both the x86 and x64 .NET Core versions (More on this here: 32 bit not in good state and workarounds and the links).
Setting "buildOptions" to "platform": "x86" and "runtimes": to "win7-x86" in project.json is not working (the x64 directory can still get created during built depending on the PATH environment variable).
This will hopefully get fixed after they switch from project.json to .csproj (why they change it here: Changes to Project.json).
At the moment when you have installed both versions like this (.NET Framework Downloads):
You need to set the order in the path environment variable:
So that the one you want to use appears first and then (re-)start Visual Studio.
To check which dotnet is currently "active" run: dotnet --info in the console.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With