Skip to content
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

Enable .NET 7 <MauiVersion> to work in .NET 8 SDK projects #17409

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

mattleibow
Copy link
Member

Description of Change

For .NET 7, we had MauiVersion as a way to control the version of maui to use. When we moved to .NET 8, this still works - but for the .NET 8 workload.

However, if you have a .NET 8 SDK and use a .NET 7 TFM, the MauiVersion still only applies to .NET 8.

This PR makes it work again for .NET 7 TFMs on a .NET 8 SDK. My initial fears of a .NET 7 MauiVersion breaking the .NET 8 workload were unfounded as the .NET 7 TFM only loads the .NET 7 maui targets - this means that when you set a number, it still only affects the .NET 7 maui. The reverse is also true, the build still works with this change because the block to load the .NET 7 framework references only applies to .NET 7 and thus will not load accidentally.

If you use a .NET 8 number for a .NET 7 TFM, the compiler complains that there are missing packs and thins is expected - there is no .NET 7 maui workload SDK for .NET 8 TFMs.

@mattleibow
Copy link
Member Author

/rebase

@mattleibow
Copy link
Member Author

/rebase

Copy link
Member

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

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

Added tests are failing because they can't find the 7.0.86 nugets

@mattleibow mattleibow changed the base branch from main to net8.0 September 26, 2023 15:45
@mattleibow mattleibow dismissed jonathanpeppers’s stale review September 26, 2023 15:45

The base branch was changed.

@mattleibow mattleibow requested a review from a team as a code owner September 26, 2023 15:45
@@ -6,6 +6,9 @@ public class BaseBuildTest
public const string DotNetCurrent = "net8.0";
public const string DotNetPrevious = "net7.0";

public const string MauiVersionCurrent = "8.0.0-rc.1.9171"; // this should not be the same as the last release
Copy link
Member

Choose a reason for hiding this comment

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

This comment is confusing. Do you mean it should not be the same as MauiVersionPrevious?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that was confusing. I'll fix.

@PureWeen PureWeen merged commit 6aac924 into net8.0 Sep 26, 2023
45 checks passed
@PureWeen PureWeen deleted the dev/mauiversion branch September 26, 2023 17:37
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2023
@samhouts samhouts added the fixed-in-8.0.0-rc.2.9373 Look for this fix in 8.0.0-rc.2.9373! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-8.0.0-rc.2.9373 Look for this fix in 8.0.0-rc.2.9373!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants