How to Handle net6.0
-only Code
#301
-
QuestionWhat is the best way to add support for Current SetupIn
The platform-specific files only compile + run on that specific platform (with the exception of ProblemThe current setup leaves us without an option for code that only runs on Currently, we handle #if !(IOS || ANDROID || MACCATALYST || WINDOWS)
// net6.0 code
#endif Here is an example from Maui/src/CommunityToolkit.Maui/Alerts/Snackbar/SnackBar.shared.cs Lines 103 to 123 in 2fba2f4 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
ProposalI propose that, in
<ItemGroup Condition="$(TargetFramework.StartsWith('net')) != true AND '$(TargetFramework)' != 'net6.0'">
<Compile Remove="**\*.net" />
<None Include="**\*.net" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
<Compile Remove="**\net\**\*.cs" />
<None Include="**\net\**\*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
</ItemGroup> This would then allow us to create partial classes for Unknowns / ConcernsBefore implementing this, I have one major concern: How will this affect .NET MAUI apps that don't use a single project + multi-targeting? If a .NET MAUI app has a If the This likely won't be a common scenario, but it is a valid .NET architecture that we should take into account to avoid future problems. |
Beta Was this translation helpful? Give feedback.
-
I believe this one is resolved by #576 |
Beta Was this translation helpful? Give feedback.
-
Closed as answered |
Beta Was this translation helpful? Give feedback.
I believe this one is resolved by #576