home.social

#csharp — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #csharp, aggregated by home.social.

  1. last Tuesday C# released a new version and I rushed to release my own game engine, Turian, totally in dotnet 11, with the new Android export fully on CoreCLR (AFAIK, the first and only engine do do so). So *Turian* 4.0.0 is out at `turian.mass4.org`! Its very new engine, but I now enter in a stage of actually making the first Turian game.

    ?

  2. Because MSYS2 and batch files don’t mix, I decided to redo my tortured but somewhat clever batch file as a proper, compiled program that runs anywhere. And then I had what I thought was a brilliant idea: why not use this as an opportunity to learn C#? If I’m gonna build a thing for Windows, might as well do it the Microsoft way, just to see what it’s like.

    Unsurprisingly, it was rough at first. Learning a new language—and learning Visual Studio on top of that—is kind of a lot. Thankfully, there’s a wealth of documentation and code samples available, and I have some prior experience with C and C++. Didn’t take me long to adapt to C#, which felt similar enough. It also helped that the batch file was structured like a C/C++ program, so I already had a blueprint.

    At the time, I found it frustrating, and there were plenty of times when I wanted to bang my head on my keyboard or some other solid surface. But now that I’m on the other side of it, you know what? I actually enjoyed it. I didn’t think I would enjoy C# and Visual Studio (because Microsoft), but it turns out I really like both.

    I liked both even more after the next part.

    github.com/digichelle/odctl-win

    #programming #CSharp #DotNet #VisualStudio

  3. Installing .NET 11.0 on Ubuntu proot-distro with Termux on Android

    .NET 11.0 is a new version of the modern .NET framework that brings several improvements across different areas of the software development kit, including runtime improvements, new APIs in .NET libraries (like richer JSON and union types), and many more improvements.

    Normally, any .NET applications that are built for a specific platform can be run normally, such as Android applications made with MAUI. However, what if you’ve planned to run a CLI .NET application on Android? Or an application for computers? Termux can provide you with a solution.

    Recent improvements to Termux involved changing how proot-distro downloads the distribution containers so that it utilizes Docker Hub to download the necessary assets and configure them to be usable. Follow the below steps to install .NET 11.0 with Ubuntu proot-distro.

    1. Install Termux from F-Droid.
      • For Samsung devices, you might want to turn off the Auto Blocker feature so that you can install it. You can also use the Play Store version, but we haven’t tested it yet, and your mileage may vary.
    2. Open Termux, and let it configure itself. After that, upgrade all packages using pkg upgrade.
      • If you’re prompted to choose whether to keep your own changes or to install the package-supplied version, just press ENTER on your phone’s keyboard.
    3. Once all necessary upgrades are complete, you can now install the proot-distro program using pkg install proot-distro.
    4. Afterwards, install the Ubuntu 26.10 Docker container with proot-distro install ubuntu:26.10.
      • It might take a while, depending on your internet connection.
    5. Now, you can login to the container with proot-distro login ubuntu.
    6. Before installing any packages in the Ubuntu proot environment, you’ll have to check to see if there are any package updates with apt update.
      • If there are any, run apt dist-upgrade to upgrade all packages.
    7. Install .NET SDK 11.0 or .NET Runtime 11.0, depending on your use case.
      • If you want to build .NET applications, install the SDK using apt install dotnet-sdk-11.0.
      • If you want to just run .NET applications, install the runtime using apt install dotnet-runtime-11.0.
    8. If you’ve installed the SDK, verify that the application actually builds.
      • Create a new directory, such as test (mkdir test), and change the current directory to it (cd test)
      • Create a new .NET console project with dotnet new console --use-program-main.
      • Verify that it actually builds using dotnet run.

    However, as of now, you may be running into an issue where the building stage of any application may fail with error messages that are similar to this:

     GC heap initialization failed with error 0x8007000E  Failed to create CoreCLR, HRESULT: 0x8007000E 

    In this case, you’ll have to add an environment variable that changes the GC heap hard limit value to an acceptable value so that you can build and run applications on Android devices. In order to do this temporarily, append the environment variable before the command, such as this:

     $ DOTNET_GCHeapHardLimit=1C0000000 dotnet build 

    If this works, you can add a line that exports this environment variable to your ~/.profile like this:

     $ echo "export DOTNET_GCHeapHardLimit=1C0000000" >> ~/.profile  $ . ~/.profile 

    Once done, exit and re-enter your proot environment, and you should be able to build and run .NET applications.

    Please note that .NET 11.0 is not available on Ubuntu 26.04 LTS official repositories yet.

    #NET #2604 #2604LTS #Android #C #csharp #dotnet #news #oneUi #Proot #ProotDistro #Samsung #smartphone #Tech #Technology #Termux #Ubuntu #Ubuntu2604 #Ubuntu2604LTS #Ubuntu2604LTSResolute #Ubuntu2604LTSResoluteRaccoon #Ubuntu2604Resolute #Ubuntu2604ResoluteRaccoon #ubuntuProot #update
Share on Mastodon

Enter the server where you have an account.