Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ben 10 posts 121 karma points
    Nov 21, 2024 @ 21:49
    Ben
    0

    Has anyone managed to get Umbraco 15 stood up on Ubuntu Linux? (u: fixed, with solution!)

    Running: Umbraco 15, .NET 9 and Ubuntu Linux 24.04 LTS.

    I continue to run into the following error on application start:

    Unhandled exception. System.TypeLoadException: Could not load type 'Microsoft.AspNetCore.Builder.IISServerOptions' from assembly 'Microsoft.AspNetCore.Server.IIS, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
    

    It seems like the error is getting generated here (Github Source), but no changes were made to this class method between v14 and v15.

    My Ubuntu server has .NET 9 installed:

    % sudo apt install dotnet9
    

    And I've added UseKestrel to my Program.cs file.

    builder.WebHost.UseKestrel(options => options.AddServerHeader = false);
    

    Trying to decipher if this is an Umbraco issue, or a .NET 9 issue... I'm leaning toward .NET. Possibly some kind of minor version mismatch... but application has been running just fine locally on MacOS.

  • David Jazbec 22 posts 144 karma points
    Nov 22, 2024 @ 07:29
    David Jazbec
    0

    Hi Ben,

    I built fresh Umbraco 15 instance from the project template on linux (Mint) and it ran without problems.

  • Ben 10 posts 121 karma points
    30 days ago
    Ben
    100

    Okay, the workaround for this is that you (as of current writing) need to manually install .NET 9.0 on Ubuntu.

    For some reason, something is just not right about the dotnet packages in the MS package manager backports collection. But if you manually install dotnet-9, you should be able to get your application stood up.

    Here's what I did:

    1) Download the latest .net binary

    % cd ~
    % wget https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-9.0.100-linux-x64-binaries
    

    2) Unpack the tar file into /usr/local/dotnet (I am more of a BSD kind of a guy, and we typically use /usr/local as the dumping ground for software we're installing. It's a good, clean place to put this binary.)

    % sudo mkdir -p /usr/local/dotnet
    % sudo tar zxf dotnet-sdk-9.0.100-linux-x64.tar.gz -C /usr/local/dotnet
    

    If you're using Ubuntu, you're probably using bash (vs zsh or other such), you'll need to add /usr/local/dotnet to your path.

    3) Edit your shell profile. I picked .profile, because it already existed. Add the following lines to the end of the file.

    % nano ~/.profile
    
    export PATH="$PATH:/usr/local/dotnet"
    export DOTNET_ROOT="/usr/local/dotnet"
    

    Exit/disconnect from the server, then reconnect to refresh your shell session and allow the new path additions take hold.

    4) Finally, test out your install and Umbraco application.

    % dotnet --info
    

    (Should report back specs about your install.)

    % dotnet /var/www/mysite/mysite.dll
    

    (No output here is a good thing! Congrats!)

    With the eternal spirit of Neils and Per Ploug, all things are possible! Never give up! :)

    Resources

    Manual .Net install process outlined by Microsoft.

    Other discussion about this can be found on the Umbraco Discord server.

  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    1 week ago
    Markus Johansson
    0

    Thanks a lot for the detailed instructions Ben!

    I tried this out on a Ubunto 22.04-install where I had installed .NET 9 using apt-get before trying this.

    In my case, I had to go to https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-9.0.100-linux-x64-binaries and use the link to the actual binaries.

    After following the instructions, the dotnet command still triggered the "old" installation so I had to change ~/.profile to do this:

    export PATH="/usr/local/dotnet:$PATH"
    export DOTNET_ROOT="/usr/local/dotnet"
    

    Basically lookin in the new /usr/local/dotnet folder first. After this things works great and Umbraco runs! 🥳

    Thanks again!

Please Sign in or register to post replies

Write your reply to:

Draft