Skip to content

Conversation

@jonathanpeppers
Copy link
Member

As we consume nightly .NET 8 builds, they sometimes depend on nightly .NET 7 builds.

One error you can run into is:

error NU1102: Unable to find package Microsoft.AspNetCore.App.Ref with version (= 7.0.11)
error NU1102: Unable to find package Microsoft.WindowsDesktop.App.Ref with version (= 7.0.11)

For projects that are not even ASP.NET or Windows desktop apps! To even be able to access these feeds, they would be something like:

<add key="darc-pub-dotnet-aspnetcore-[SHA]" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-aspnetcore-[SHA]/nuget/v3/index.json" />
<add key="darc-pub-dotnet-windowsdesktop-[SHA]" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-windowsdesktop-[SHA]/nuget/v3/index.json" />

We don't currently track these packages, because we don't actually use them.

The .NET SDK team has provided a setting to workaround this, $(DisableTransitiveFrameworkReferenceDownloads), we have been using in xamarin/xamarin-android for some time:

https://github.com/xamarin/xamarin-android/blob/6768c731d327c8148c45304c895ca8987a9cc2f1/Directory.Build.props#L26-L27

Let's do the same here to avoid this problem as seen in 81c228d.

As we consume nightly .NET 8 builds, they sometimes depend on nightly
.NET 7 builds.

One error you can run into is:

    error NU1102: Unable to find package Microsoft.AspNetCore.App.Ref with version (= 7.0.11)
    error NU1102: Unable to find package Microsoft.WindowsDesktop.App.Ref with version (= 7.0.11)

For projects that are not even ASP.NET or Windows desktop apps! To even
be able to access these feeds, they would be something like:

    <add key="darc-pub-dotnet-aspnetcore-[SHA]" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-aspnetcore-[SHA]/nuget/v3/index.json" />
    <add key="darc-pub-dotnet-windowsdesktop-[SHA]" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-windowsdesktop-[SHA]/nuget/v3/index.json" />

We don't currently track these packages, because we don't actually use
them.

The .NET SDK team has provided a setting to workaround this,
`$(DisableTransitiveFrameworkReferenceDownloads)`, we have been using in
xamarin/xamarin-android for some time:

https://github.com/xamarin/xamarin-android/blob/6768c731d327c8148c45304c895ca8987a9cc2f1/Directory.Build.props#L26-L27

Let's do the same here to avoid this problem as seen in 81c228d.
@jonpryor jonpryor merged commit 7961b36 into dotnet:main Aug 23, 2023
@jonathanpeppers jonathanpeppers deleted the DisableTransitiveFrameworkReferenceDownloads branch August 23, 2023 18:36
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Sep 1, 2023
Changes: dotnet/java-interop@5adb4d4...5bb0d24

  * dotnet/java-interop@5bb0d24b: [build] Add support for JDK 17 (dotnet/java-interop#1141)
  * dotnet/java-interop@7e3bd2f2: Revert "[build] Enable NuGet's Central Package Management (dotnet/java-interop#1114)" (dotnet/java-interop#1138)
  * dotnet/java-interop@7961b360: [build] set `$(DisableTransitiveFrameworkReferenceDownloads)`=true (dotnet/java-interop#1137)

Context: dotnet#8304
Context: dotnet#8029
Context: https://web.archive.org/web/20230507035529/https://developer.android.com/studio/releases/#jdk-17

> Starting from Android Studio Flamingo Canary 3, the Studio IDE is
> bundled with JDK 17.

Because of dotnet#8029 we know we *can* use JDK 17.

Because of dotnet#8304 we know we *should* use JDK 17.

Update `xaprepare` so that Microsoft OpenJDK 17.0.8 is provisioned
for the build.  Note: `$(_JavacSourceVersion)` and
`$(_JavacTargetVersion)` are *not* changed, so that our built
`.jar` tooling can still *run* on JDK-11.

Update to use Gradle 8.1.1.  This is needed for JDK-17 support.

Update `$(LatestSupportedJavaVersion)` to 17.0.99 so that JDK 17 can
be used by .NET Android projects by default.
jonpryor added a commit to dotnet/android that referenced this pull request Sep 2, 2023
Changes: dotnet/java-interop@5adb4d4...5bb0d24

  * dotnet/java-interop@5bb0d24b: [build] Add support for JDK 17 (dotnet/java-interop#1141)
  * dotnet/java-interop@7e3bd2f2: Revert "[build] Enable NuGet's Central Package Management (dotnet/java-interop#1114)" (dotnet/java-interop#1138)
  * dotnet/java-interop@7961b360: [build] set `$(DisableTransitiveFrameworkReferenceDownloads)`=true (dotnet/java-interop#1137)

Context: #8304
Context: #8029
Context: https://web.archive.org/web/20230507035529/https://developer.android.com/studio/releases/#jdk-17

> Starting from Android Studio Flamingo Canary 3, the Studio IDE is
> bundled with JDK 17.

Because of #8029 we know we *can* use JDK 17.

Because of #8304 we know we *should* use JDK 17.

Update `xaprepare` so that Microsoft OpenJDK 17.0.8 is provisioned
for the build.  Note: `$(_JavacSourceVersion)` and
`$(_JavacTargetVersion)` are *not* changed, so that our built
`.jar` tooling can still *run* on JDK-11.

Update to use Gradle 8.1.1.  This is needed for JDK-17 support.

Update `$(LatestSupportedJavaVersion)` to 17.0.99 so that JDK 17 can
be used by .NET Android projects by default.
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants