-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
e7327ee
to
f687a72
Compare
/rebase |
f687a72
to
e975895
Compare
/rebase |
e975895
to
06f1664
Compare
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.
Added tests are failing because they can't find the 7.0.86 nugets
src/TestUtils/src/Microsoft.Maui.IntegrationTests/BaseBuildTest.cs
Outdated
Show resolved
Hide resolved
The base branch was changed.
06f1664
to
d556132
Compare
@@ -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 |
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.
This comment is confusing. Do you mean it should not be the same as MauiVersionPrevious
?
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.
Yeah, that was confusing. I'll fix.
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.