-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ARM32 & ARM64 As AvailablePlatforms #6322
Conversation
<AvailablePlatforms Condition="$([MSBuild]::IsOSPlatform('linux'))">$(AvailablePlatforms),ARM32,ARM64</AvailablePlatforms> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net5.0'))"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this strictly check for net5.0, or is anything greater than/compatible with net5.0 fine? /cc: @tommcdon
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net5.0'))"> | ||
<!-- Need to check console and windows here. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From original issue:
@dsplaisted how do we go about checking if we're specifically a console app?
The only reference to a console app check I've found is line 5647 on Microsoft.Common.CurrentVersion.Targets:
<Error Condition="'$(OutputType)'!='winexe' and '$(OutputType)'!='exe' and '$(OutputType)'!='appcontainerexe'" Text="Publish is only valid for 'Windows Application' or 'Console Application' project types."/>
Non-console apps would have a FrameworkReference to the WindowsDesktop or AspNetCore framework. There wouldn't be a RuntimePack for the ARM RuntimeIdentifiers that aren't supported, so you'd get an error building a self-contained app targeting ARM. I don't think we have a block that would prevent you from building a shared framework app using an ARM RuntimeIdentifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My first inclination would be to put this logic in dotnet/sdk instead of in MSBuild. That's generally where we put logic that is specific to .NET 5 / .NET Core, as you need to use SDK-style projects to build for those platforms.
This also should not be checking exact strings for the TargetFramework
. It should check TargetFrameworkIdentifier
and TargetFrameworkVersion
.
@dsplaisted Understood, is there an ideal file to place this logic into? Microsoft.Net.Sdk.targets maybe? |
Closing in favor of dotnet/sdk#16802 |
Fixes #5951
Context
Summary: .NET 5 is adding support for Windows ARM64. Visual Studio .NET Core projects should allow you target ARM64 in addition to x86/x64/arm32.
This is planned to be based off of the
AvailablePlatforms
property.Changes Made
In Microsoft.Common.CurrentVersion.targets, added conditional propertygroups based on TargetFramework to add ARM32/64 as a platform.
Testing
Needs dotnet/project-system#7081 to account for
AvailablePlatforms
so we can see it in the Platform Target dropdown under project properties.Notes
What we're trying to apply ARM to: