Skip to content

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Dec 21, 2022

Backport of #79240. Since I am touching this, I'm also backporting a change to the warning message from #75043.

Customer Impact

Context: dotnet/sdk#28823

PublishAot with .NET 8 SDK targeting net7.0 produces the following warning:

Set PublishAot property to true and delete explicit 'Microsoft.DotNet.ILCompiler' package reference in your project file. Explicit 'Microsoft.DotNet.ILCompiler' package reference can run into version errors.

The 7.0 ILCompiler package produces this warning. This is by design for 7.0 scenarios, but the .NET 8 SDK uses an implicit PackageReference to reference the 7.0 ILCompiler, which should not warn.

This fix removes the warning in the .NET 8 SDK scenario, and rewords the warning when using an explicit PackageReference (a 7.0 scenario) to avoid recommendation to set PublishAot, since this is only reachable when PublishAot is already set.

Testing

There are existing tests for the unchanged behavior in https://github.com/dotnet/sdk/blob/7663c1f4d5896acfb71067be3fb9510be7bde4f1/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs#L266.
Tests are being added for the 8.0 behavior in dotnet/sdk#29393.

Risk

Very low. The implicit packagereference didn't exist in 7.0, so only the warning message changes when using the NET 7 SDK.

@sbomer sbomer requested a review from LakshanF December 21, 2022 01:21
@ghost ghost assigned sbomer Dec 21, 2022
@ghost
Copy link

ghost commented Dec 21, 2022

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #79240. Since I am touching this, I'm also backporting a change to the warning message from #75043.

Customer Impact

Necessary to fix dotnet/sdk#28823 when targeting 7.0 from a .NET 8 SDK.

Testing

There are existing tests for the unchanged behavior in https://github.com/dotnet/sdk/blob/7663c1f4d5896acfb71067be3fb9510be7bde4f1/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs#L266.
Tests are being added for the 8.0 behavior in dotnet/sdk#29393.

Risk

Very low. The implicit packagereference didn't exist in 7.0, so only the warning message changes in 7.0.

Author: sbomer
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@sbomer sbomer added the Servicing-consider Issue for next servicing release review label Dec 21, 2022
@marek-safar marek-safar added this to the 7.0.x milestone Dec 22, 2022
@jeffschwMSFT jeffschwMSFT removed the Servicing-consider Issue for next servicing release review label Jan 3, 2023
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved. please get a code review and we will take for consideration in 7.0.x

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Jan 3, 2023
Copy link
Contributor

@LakshanF LakshanF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@rbhanda rbhanda modified the milestones: 7.0.x, 7.0.3 Jan 5, 2023
@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 5, 2023
@carlossanlop
Copy link
Contributor

Approved by Tactics (7.0.3).
Signed off by area owners.
No OOB changes needed.
CI is green.
Ready to merge. :shipit:

@carlossanlop carlossanlop merged commit 4769ff2 into dotnet:release/7.0 Jan 5, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Feb 5, 2023
@sbomer sbomer deleted the fixPackageWarning7 branch November 3, 2023 18:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-NativeAOT-coreclr Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants