-
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
Remove legacy TFMs #4403
Remove legacy TFMs #4403
Conversation
Adds an omnisharp.json config file to help ignore some projects that don't load well. But also add an _omnisharp.sln since Omnisharp basically finds the first solution it can regardless of the config file excludes and will try and load those projects. This puts it high in the list and is generally convenient to work on the main projects from the repo within omnisharp.
This will make net7.0 easier to start building against too.
These targets actually ship so they need to not just _use_ the Maui properties from directory build props
It gets updated from other targets
because we don't want to set these properties for WPF projects... | ||
There's probably a better way we should find to infer this | ||
--> | ||
<PropertyGroup Condition="'$(_MauiTargetPlatformIsWindows)' == 'True' AND $(TargetFramework.Contains('-windows10'))"> |
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.
If there's an easy better way, we can update this right away before merge, but leaving the hack that seemed to work from before for now.
src/Compatibility/Android.FormsViewGroup/src/Compatibility.Android.FormsViewGroup.csproj
Show resolved
Hide resolved
src/Compatibility/Android.FormsViewGroup/src/Compatibility.Android.FormsViewGroup.csproj
Show resolved
Hide resolved
src/Compatibility/Android.FormsViewGroup/src/Compatibility.Android.FormsViewGroup.csproj
Outdated
Show resolved
Hide resolved
<PropertyGroup> | ||
<TargetFrameworks>netstandard2.1;netstandard2.0;$(MauiPlatforms)</TargetFrameworks> | ||
<TargetFrameworks>netstandard2.1;netstandard2.0;$(_MauiDotNetTfm);$(MauiPlatforms)</TargetFrameworks> |
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.
Is there any reason we are still building for netstandard2.1;netstandard2.0
? I would assume that Maui only needs to build for net6.0
going forward.
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 assembly gets loaded by MSBuild (.NET Framework in VS), so that is why we have netstandard2.0
.
I'm not sure why we'd have netstandard2.1
, though?
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.
For reference, WinForms only builds for the "current" .NET TFM:
Same for asp.net:
https://github.com/dotnet/aspnetcore/blob/b89eba6c3cda331ee98063e3c4a04267ec540315/src/DefaultBuilder/src/Microsoft.AspNetCore.csproj#L4
and
https://github.com/dotnet/aspnetcore/blob/9d6f7e3b2b7eb12abc3a656827545a4ceb2ce090/eng/Versions.props#L44
Same for wpf:
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 assembly gets loaded by MSBuild (.NET Framework in VS)
Really? Why?
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.
MSBuild task?
The "XamlC" MSBuild task, and maybe others, use some of the core types. It's possible this could be reworked, but this was the same in Xamarin.Forms. |
This seems to have removed So, for example, Footnotes
|
@chucker there was never a |
I wasn't, not in MAUI. But the blog post introducing Essentials implies that this replaces Xamarin Essentials, and in a |
@chucker I'd recommend just filing a new issue titled "Essentials support for net6.0-macos", so that folks can upvote it. |
The legacy TFM's are not helpful at this point anyway, so removing them may make things less confusing to not have multiple projects. This helps omnisharp parse things better too.
I've added an
omnisharp.json
file to exclude some projects/files from loading...However, roslyn still loads a .sln file, so I've added
_omnisharp.sln
. It's not obvious which 'first' .sln it finds, in testing sometimes the_omnisharp.sln
was found first, other times, one within Compatibility was - there's no way seemingly to control which one to load first. So, we could rename the sln toMicrosoft.Maui-vscode.sln
or something similar if anyone objects to the current name I used.Once you do load a .sln (you can tell vscode which one to use and omnisharp will re-evaluate things), it will factor in the config file's excludes.
This makes vscode much faster to use on macOS in particular.
Update
Removed all
net6.0
versioning from .targets/.props checks, and .csproj's (except templates because those need to have the right TFM though we can probably make that a variable too). This will help make it easier to build againstnet7.0
and future versions.This consolidates also now the platform identifier checking, and uses a property msbuild function
$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramewrok)')
to assign the platform in a property in Directory.Build.props so that it's available to use everywhere (along with some platform properties like_MauiTargetPlatformIsAndroid
).Finally, it also removes some old msbuild logic that's now unnecessary.