Can't build ASP.NET Core project using net461 and x64
See original GitHub issueAll my projects are locked to x64 configuration (AnyCPU is deleted) because, well, it only runs on x64 and depends on x64 native binaries.
My ASP.NET core project is configured to use net461 as I need to the full .net framework in order to reference the Microsoft.WindowsAzure.ServiceBus nuget and to reference my class libraries.
project.json excerpt:
"frameworks": {
"net461": {}
},
"runtimes": {
"win7-x64": {},
"win8-x64": {},
"win10-x64": {}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true,
"platform": "x64"
},
Building the project now gives me an error:
2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(724,5): error : The OutputPath property is not set for project 'BlackCat.Automation.Messaging.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' 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.
2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(724,5): error : The OutputPath property is not set for project 'BlackCat.Core.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' 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.
I’ve tried manually changing the Any CPU
=> x64
in the sln file but it reverts back once you build the project.
Any ideas?
EDIT: Even after adding the AnyCPU configuration for the two projects referenced here, the project built successfully but while I tried to publish with win7-x64 runtime, it built the win10-x64 and couldn’t find the output files. Switching to win10-x64 failed to start the app on Windows Server 2012 R2.
It seems to me that the whole .NET core ecosystem is very messy even at RC2 when it comes to supporting anything “non-standard” (limited to .NET Core apps). I would love to see an example project with this configuration: .NET Core APIs, to get advantage of all the goodies such as webpack etc but with reference to net461 - not all of us are interested in deploying to Linux right now…
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:14
The problem is back with core 2.0… Setting RuntimeIdentifier does not help anymore…
A workaround is to ‘Unload a Project’ and edit runtime version in your .csproj file manually.
It is very straightforward and works like a charm.