Skip to content

Don't add AOT package in restore for < net7 #31201

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

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ var runtimeRequiredByDeployment
}
}

if (AotEnabled)
if (AotEnabled && _normalizedTargetFrameworkVersion.Major >= 7)
{
switch (AddToolPack(ToolPackType.ILCompiler, _normalizedTargetFrameworkVersion, packagesToDownload, implicitPackageReferences))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ Copyright (c) .NET Foundation. All rights reserved.
ResourceName="PublishProfileNotPresent"
FormatArguments="$(PublishProfile)"/>

<!-- If the TFM is valid, ProcessFrameworkReferences task will warn in restore. If we reach here without a ILCompiler pack, its an invalid TFM -->
<NETSdkError Condition="'$(PublishAOT)' == 'true' and '@(TargetILCompilerPack)' == '' and '@(HostILCompilerPack)' == ''"
ResourceName="AotUnsupportedTargetFramework" />

<!-- Projects in a solution cannot have conflicting configurations. This checks if PublishRelease conflicted at runtime to avoid extra project evaluations.
SolutionExt is used to check if we are publishing a solution. Will be undefined if not.-->
<NETSdkError Condition="'$(_IsPublishing)' == 'true' and
Expand Down