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

.NET6 out of support should be a WARNING, not an ERROR #8566

Closed
tuyen-vuduc opened this issue Dec 6, 2023 · 3 comments
Closed

.NET6 out of support should be a WARNING, not an ERROR #8566

tuyen-vuduc opened this issue Dec 6, 2023 · 3 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. Area: Bindings Issues in Java Library Binding projects.

Comments

@tuyen-vuduc
Copy link

Android application type

Classic Xamarin.Android (MonoAndroid13.0, etc.)

Affected platform version

VS 2022 17.8.2

Description

I am a library owner of many Xamarin binding libraries. Recently, I tried to add .NET8-Android as another supported framework to my libraries, it shows this error

error NETSDK1202: The workload 'net6.0-android' is out of support and will not receive security updates in the future.

It's really annoying. .NET6 is out of support, doesn't mean the libraries for it are also discontinued or. The error is not only if .NET6 is included, MonoAndroid has the same problem. Many developers still use my libraries and not ready to move to .NET8 yet, I still want to keep .NET6-android and MonoAndroid as supported frameworks.

If the error above is just a warning, it'll be very great. I can update my libraries to support .NET8 without any problems.

I used to think .NET6 binding libraries will work for .NET7 libraries, but it doesn't. I had to add .NET7 as supported framework for my libraries in the part. If .NET7 libraries will just work for .NET8, I will not upgrade my libraries to support .NET8 yet.

Please try and confirm by checking out my Mapbox for .NET libraries.

Steps to Reproduce

  1. Clone my repo dotnet-binding-utils
  2. Switch to branch dotnet8-issue
  3. Change directory to path-to-your-local-repo/qs/org.jfrog.cardinalcommerce.gradle--cardinalmobilesdk
  4. Run this command in Git Bash (Windows) or Terminal (MacOS) sh build.sh --base-path $PWD

Did you find any workaround?

No. Not add .NET8 support for now

Relevant log output

C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(38,5): error NETSDK1202: The workload 'net6.0-android' is out of suppo
rt and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy. [path-to-the-repo\qs\org.jfrog.cardinalcommerce.gradle--cardinalmobilesdk\generated\Org.Jfrog.Cardinalcommerce.Gradle.Cardinalmobilesdk\Org.Jfrog.Cardinalcommerce.Gradle.Cardinalmobilesdk.csp 
roj::TargetFramework=net6.0-android31.0]
@tuyen-vuduc tuyen-vuduc added the needs-triage Issues that need to be assigned. label Dec 6, 2023
@jpobst
Copy link
Contributor

jpobst commented Dec 6, 2023

Unfortunately, it is an error because the .NET 8 SDK doesn't know how to build net6.0-android projects. If it was a warning, it still would not work.

#7900
https://learn.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1202

However, a net6.0-android binding library should definitely work in a net7.0-android and net8.0-android application.

For the 500+ AndroidX/GooglePlayServices bindings we maintain we only added net7.0-android a few weeks ago. We had shipped only net6.0-android bindings for the entirety of the .NET 7 and .NET 8 preview timeframe.

If there's a reason your net6.0-android bindings don't work on newer versions I think that's the bug we need to tackle.

@jpobst jpobst added Area: App+Library Build Issues when building Library projects or Application projects. Area: Bindings Issues in Java Library Binding projects. and removed needs-triage Issues that need to be assigned. labels Dec 6, 2023
@jonpryor
Copy link
Member

jonpryor commented Dec 6, 2023

@tuyen-vuduc : could you please elaborate on:

I used to think .NET6 binding libraries will work for .NET7 libraries, but it doesn't.

Seconding @jpobst' comment, .NET 6 binding libraries should work as-is* on both .NET 7 and .NET 8. (Xamarin.Android binding libraries should more-or-less work as-is on .NET 7 and .NET 8…)

* …except when they can't, usually because of dependencies. A binding library that binds a .jar with no additional dependencies should work without change. A binding library that depends on Xamarin.Android.Support libraries is gonna cause pain (some no-longer-supported migration utilities need to run, which can slow down or otherwise break the build; you should migrate to androidx/Xamarin.AndroidX libraries). If dependencies have changed, it's possible that types may have moved or been renamed, e.g. dotnet/java-interop#1094 , dotnet/android-libraries#764 , etc.

@jpobst
Copy link
Contributor

jpobst commented Dec 13, 2023

Closing this issue as WONTFIX. If there is a case where a .NET 6 Android binding library doesn't work in .NET 7 or .NET 8, please file a new issue for it.

Thanks!

@jpobst jpobst closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App+Library Build Issues when building Library projects or Application projects. Area: Bindings Issues in Java Library Binding projects.
Projects
None yet
Development

No branches or pull requests

3 participants