Observations on .Net 11

I have upgraded all of my development host computers to .Net SDK 11, upgraded all of my target computers to .Net Runtime 11, and updated all of my projects and templates for same.

This will be the first in a series of posts containing my observations of the interactions between RemObjects Elements (all version 14.0.0.3155) and .Net 11.

macOS

Building in the Fire IDE produces perfect executables. The .runtimeconfig.json file correctly references .Net 11.

Building from the command line with the following command:

/Applications/Fire.app/Contents/Resources/DotNet/dotnet exec /Applications/Fire.app/Contents/Resources/EBuild.dll --configuration:Release --setting:ReferencePath="/Applications/Fire.app/Contents/Resources/References/Echoes/NET"

also produces perfect executables, even though /Applications/Fire.app/Contents/Resources/DotNet/dotnet is version 10.0.14.

I did learn the hard way to remove an old Fire.app directory before copying the new one.

Windows

Building in either Visual Studio or Water IDE produces perfect executables. The .runtimeconfig.json file correctly references .Net 11.

Building from the command line with the following command:

"C:/Program Files (x86)/RemObjects Software/Elements/Bin/EBuild.exe" --configuration:Release also produced perfect executables

also produces perfect executables. The .runtimeconfig.json file correctly references .Net 11.

Linux

Here things fail. Building in the Earth IDE succeeds, but the .runtimeconfig.json references .Net 10:

{
  "runtimeOptions": {
    "tfm": ".NETCoreApp,Version=v10.0",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "10.0.14"
    }
  }
}

This was what I actually expected, at best. I was surprised that macOS and Windows produced .Net 11 executables.

Building from the command line with the following command:

ebuild --configuration:Release --setting:ReferencePath="/usr/local/lib/elements/References/Echoes/NET"

fails with the following error messages:

You must install or update .NET to run this application.

App: /usr/local/lib/elements-14.0.0.3153/Core/EBuild.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '10.0.9' (x64)
.NET location: /usr/local/lib/dotnet-sdk-11.0.100/

The following frameworks were found:
  11.0.0 at [/usr/local/lib/dotnet-sdk-11.0.100/shared/Microsoft.NETCore.App]

Learn more:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=10.0.9&arch=x64&rid=linux-x64&os=linux

I tried manually editing /usr/local/lib/elements-14.0.0.3153/Core/EBuild.runtimeconfig.json to reference .Net 11. Now I can build the project, but the resulting application program .runtimeconfig.json references .Net 10.

Can you elaborate on this one? Normally, if you copy Fire.app into e.g. Applications, it shouldm replace it, not merge…

Curious. I would not expect this to differ between platforms; it’s probably something else causing this. But i will investigate.

This one is expected. The compiler is built for .NET Core 10.0.14, so you do need .NET 10 installed, release 14 or later. Microsoft, in their infinite wisdom, made ot so that .NET Core runtimes are not compatible for compiled binaries between major versions.

Earth bundles .NET 10.0.14 in its flatpak to run, and uses that when you run the compiler inside it. But the manually installed compiler cannot see that runtime, it needs it installed locally on system level. I will update/improve the documentation in that regard.

I’m shocked that worked. Maybe just removing the .json might have worked too. Again, .NET Core is oddly silly in that regard.

So same as before. Not unexpected – whatever the cause there is.

I’ll see if I can reproduce this or figure out what’s going on so that the built project inherits a wrong runtime.

Do you have “.NETCoreApp11” set in your project explicitly, or is the setting empty/jst “NETCoreApp” and left to pick up the latest version automatically? If the latter, does setting 11 explicitly fix it?

This part we cannot reproduce. But can you retest with .3155 from yesterday; thats the verskon im testing with and iirc we did make a few tweaks to deps generation.

With .NET 11 installed, the output consistently is .NET 11

(with .NET 11 not installed, theres’ inconsistencies and we’ll address that; this is also what happens when building with Earths embedded compiler, which doesn’t see the external .NET 11. We’ll address that too).

My Elements projects all have the target framework set to .NetCore. I tried changing it to .NetCore11.0: The Linux command line build (after patching EBuild.runtimeconfig.json) now produces a proper .runtimeconfig.json for .Net 11.

Earth produces the following weird hybrid (not too surprising, because of the flatpak isolation):

{
"runtimeOptions": {
"tfm": ".NETCoreApp,Version=v11.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "10.0.15"
}
}
}

Since all macOS and Windows variations seem to work fine for .Net 11, I think I’ll leave my project configurations alone and just wait for the Linux tools to catch up.

I am slightly curious why the Fire app for macOS includes a dotnet runtime while the Linux zip file does not. Another question that occurred to me is how many programs besides EBuild within the Elements toolchain require the dotnet runtime? If EBuild is the only one, it could be delivered as a single-file self-contained .Net app, at least in the zip file.

Perfect.

Yes, that’s what we saw here too. It’s fixed now.

What happened was that if the requested SDK was not installed, the best installed one was used; that was 10.0.15 in your case. Now instead it will use x.0.0 matching the requested SDK.

Also, EBuild from inside Earth will now detect a >NET SDK installed externally, you would later get e.g. 11.0.5, if that was what is installed (.NET 11 currently is still at 11.0.0, so right no there’s no visible difference between it finding the SDK or not. :).

What I couldn’t reproduce or fix was the problem with getting 10 in the version when building externally with_ 11 present.

Are you good for now until next week, having set .net11 explicitly, or would you like an interim build with the fixes?

I’m to wait for the next stable releases. Thanks!