Reputation: 770
Is it possible to change the build platform from Any CPU to x64 for an ASP.NET Core project within VS 2015?
Every time I try to edit it via the configuration manager it reverts back to Any CPU. Even editing the solution file (.sln) didn't work as VS silently reset it when it next reloaded the project/solution... It appears to be the same issue as reported here.
I ask because it is "stuck" on Any CPU and this is causing errors when building the project as it references other projects which are only configured for x64 platform. The actual error is:
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(724,5): error : The OutputPath property is not set for project 'projectname.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Release' Platform='AnyCPU'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform.
Upvotes: 4
Views: 1702
Reputation: 10889
You can specify a target platform using the buildOptions
element in the project.json
file:
{
"buildOptions": {
"platform": "x64"
},
// other stuff
}
Upvotes: 1