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

Binding projects don't work in .NET 9 RC 2 #21407

Closed
rolfbjarne opened this issue Oct 10, 2024 · 2 comments
Closed

Binding projects don't work in .NET 9 RC 2 #21407

rolfbjarne opened this issue Oct 10, 2024 · 2 comments
Labels
bug If an issue is a bug or a pull request a bug fix generator Issues affecting the generator regression The issue or pull request is a regression
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Oct 10, 2024

Running bgen with dotnet from .NET 9 RC 2 yields an error like this:

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.0/18.0.9600-net9-rc2/tools/msbuild/iOS/Xamarin.Shared.targets(1776,3): error MSB6006: "dotnet" exited with code 150.

Looking at a binlog, this is the reason:

You must install or update .NET to run this application.
App: /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.0/18.0.9600-net9-rc2/tools/lib/bgen/bgen.dll
Architecture: arm64
Framework: 'Microsoft.NETCore.App', version '9.0.0-rtm.24475.3' (arm64)
.NET location: /usr/local/share/dotnet/
The following frameworks were found:
  8.0.8 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  9.0.0-rc.2.24473.5 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Which is because bgen was built for a newer .NET runtime than RC 2:

$ cat /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.0/18.0.9600-net9-rc2/tools/lib/bgen/bgen.runtimeconfig.json
{
  "runtimeOptions": {
    "tfm": "net9.0",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "9.0.0-rtm.24475.3"
    },
    "rollForward": "Major",
    "configProperties": {
      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
    }
  }
}

And that's because it's the dependency we have in eng/Version.Details.xml:

<Dependency Name="Microsoft.NETCore.App.Ref" Version="9.0.0-rtm.24475.3" CoherentParentDependency="Microsoft.NET.Sdk">

The good news is that this will automatically fix itself for the final release.

It might be possible to work around this by installing a daily .NET 9 RTM build from here: https://github.com/dotnet/sdk/blob/main/documentation/package-table.md

This is partially a side effect of the fact that there were no public .NET 9 RC 2 .NET builds we could build against:

$ darc get-latest-build --repo dotnet/sdk --channel '.NET 9.0.1xx SDK RC 2'
No latest build found matching the specified criteria

Which meant we were building with an earlier version of .NET 9 (from the .NET 9.0.1xx SDK channel).

The second part to this is that not every .NET version from the .NET 9.0.1xx SDK channel can build projects that can run on the released version of RC 2, because they may reference an rtm version of dotnet/runtime. This is evidenced by this maestro bump: f419cce, which bumps to:

  • Microsoft.NET.Sdk: Version="9.0.100-rc.2.24475.4"
  • Microsoft.NETCore.App.Ref: Version="9.0.0-rtm.24475.3"

This means any projects built with this version of .NET 9 will produce *.runtimeconfig.json file requiring "Microsoft.NETCore.App.Ref=9.0.0-rtm.24475.3", which the public .NET 9 RC 2 release doesn't fulfill.

@rolfbjarne rolfbjarne added bug If an issue is a bug or a pull request a bug fix regression The issue or pull request is a regression generator Issues affecting the generator labels Oct 10, 2024
@rolfbjarne rolfbjarne added this to the .NET 9 milestone Oct 10, 2024
@rolfbjarne
Copy link
Member Author

Closing, this will be fixed in the final .NET 9 release.

@ArunaYarra
Copy link

Hi,

We are still facing this issue though we installed the .NET 9 RTM (https://aka.ms/dotnet/9.0.2xx/daily/dotnet-sdk-osx-arm64.pkg).

AXAiOSBindings_MAUI net9.0-ios failed with 1 error(s) (0.5s)
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.0/18.0.9600-net9-rc2/tools/msbuild/iOS/Xamarin.Shared.targets(1776,3): error MSB6006: "dotnet" exited with code 150.

Please help me to overcome this issue.

Thanks,
Aruna

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug If an issue is a bug or a pull request a bug fix generator Issues affecting the generator regression The issue or pull request is a regression
Projects
None yet
Development

No branches or pull requests

2 participants