Reputation: 7049
Since ASP.NET Core uses libuv, the build process needs to know whether we target 32 or 64 bit (when using .NET Framework rather then .NET Core anyway).
When I settle for 64 bit, I get the following message on publication:
error : The RuntimeIdentifier platform and the PlatformTarget must match.
But I think they do match - I had them printed with <Message />
directives from msbuild and they tell me:
1>PlatformTarget: x64
1>RuntimeIdentifier: win7-x64
Indeed the error message appears to be generated by these lines of code in the respective target definitions:
<NETSdkError Condition="'$(PlatformTarget)' != 'AnyCPU' and !$(RuntimeIdentifier.ToUpper().Contains($(PlatformTarget.ToUpper())))"
ResourceName="CannotHaveRuntimeIdentifierPlatformMismatchPlatformTarget" />
(Taken from this GitHub issue, the lines are semantically unchanged on master.)
So how does that not match? And why is this checked only on publication?
I don't think it's taking any information about the Azure App Service into account, although that's configured to be 64bit as well.
Any ideas?
Upvotes: 1
Views: 540
Reputation: 7049
I found the issue myself, it's due to a VS UI bug.
In the publication profile, there's another RuntimeIdentifier.
I checked this, but only in the VS UI and in the VS publication dialog it doesn't necessarily shows what's actually configured: If the current app is 64 bit, and 32 bit is configured, then 32 bit remains configured even though 64 bit is displayed.
Upvotes: 1
Reputation: 9850
This link describes some details: https://blogs.msdn.microsoft.com/webdev/2018/01/09/64-bit-asp-net-core-on-azure-app-service/
Upvotes: 1