The top 5 changes you’ll notice in Umbraco 9 (and why this is cool)
1. The super obvious one - the new framework.
The change from .NET Framework over to .NET Core/.NET 5 is the obvious and biggest change. Microsoft is no longer working on the older technology of .NET Framework. So an upgrade was necessary and the Umbraco development team together with the Unicore community team has brought the codebase up-to-date and in doing so will help make Umbraco attractive to new C# and .NET developers - and make the CMS more future-proof. With moving the entire codebase to .NET Core we gain performance increases due to a better underlying technology stack but I think the most common thing people associate with .NET Core is the addition of cross-platform compatibility. Yep, that's right, you can finally make some of your colleagues running on a Mac a lot happier as they can run Umbraco natively on their machine without the use of a windows virtual machine in order to do development work on an Umbraco site 🥰
Access to ASP.NET Core 5 tech
A big benefit to upgrading to this new framework is that you now get access to new technology in your Umbraco 9 projects:
Razor TagHelpers
This is an alternative approach to HTMLHelpers in Razor which allows you to add your own HTML attributes or HTML tags that can be processed by C# code before the raw HTML output is sent back from the server.
Microsoft has some great documentation on this if you want to investigate further:
Dependency Injection
Microsoft .NET Core has allowed us to use Microsoft’s DI container for Umbraco’s core code. You have the same possibilities to inject what you need into your own classes and code as required. This means that you are now able to inject services directly into your Razor views with the @inject keyword. Pretty neat.
Take a look at the documentation from Microsoft below for more in-depth details:
View Components
This is a new concept in .NET Core that allows us to have a more powerful approach to Partial Views where you no longer need to have a controller with ChildActions in them.
Take a look at the documentation from Microsoft:
As well as this great community article from Dennis Adolfie in Skrift:
2. Updated Dependencies
For Umbraco to run on .NET 5, we needed to ensure our external dependencies would also support it, so we’ve updated to newer versions or switched to projects that offer support for the new tech stack.
Client Dependency Framework is now Smidge
CDF handles asset bundling and minification inside the backoffice of the CMS. Optionally, if you want to use it in your frontend code, this is now possible thanks to a new project called Smidge by Shannon Deminick that does the same thing as CDF.
I recommend you take a look at the GitHub project documentation if you are curious about what has changed there.
ImageProcessor is now ImageSharp
This project from community member James South has also a new and updated project called ImageSharp that now works cross-platform allowing Umbraco to help you create the media crops and resizes you need for your website on umbraco 9. Thanks, James
Examine
This project from Shannon Deminick, is the tool that handles indexing and gives extensive search capabilities to your Umbraco website. Under the hood of Examine, it uses a technology called Lucene.NET and this has been updated to a newer version, compatible with .NET 5 and Umbraco 9.
3. Configuration
This is a big topic that has seen a lot of changes in Umbraco 9 due to .NET Core changing how it handles configuration. This change is probably the biggest to understand, however, this change is good and opens up to a lot of flexibility and different options, such as allowing configuration to come from various different sources be it AppSettings.json and the equivalent environment-specific overrides AppSettings.Development.json, along with them coming from environment variables used in places like Azure.
I recommend taking a look at my video to help you understand what has changed, along with a few other recommended posts to read:
With Umbraco Health Checks in the backoffice, it was previously possible to update some configuration automatically for you. With configuration changed in Umbraco 9 and it being read only, the health checks will now only prompt you on what settings and values you need to change it to.
4. Events
This has changed to use notifications as opposed to static events and has been heavily inspired by the MediatR project.
This is cool because notifications are handled by the Dependency Injection container and are not tightly coupled to the specific implementations anymore. Furthermore, we now support async notifications.
With this big change, my awesome bunch of colleagues has already got onto documenting this new approach and have examples to follow along with.
Alternatively, if you like the more “show and tell” approach, I’ve created a video that will show you how to work with the new pattern: Migrating Event Handlers to Notification Handlers in Umbraco V9
5. Packages
This is another area where we have had to change a few things. Now, packages have to be installed via Nuget. We have had to change the approach on how we install packages due to how .NET Core works where we can not populate the IOC container at runtime and restart the application like we have done in Umbraco 8 with the package.zips.
So the option to install packages via the Umbraco backoffice with a simple click is no longer an option, however, an upside to this is that we now have implemented package migrations which allow you to run custom code and migration code when your package is installed or upgraded. You can learn more about the new package approach in Umbraco 9 in the “Packages in Umbraco 9 via NuGet” blog post.
All Umbraco HQ packages (Forms and Deploy) are ready for Umbraco 9 and we’re pleased to see that many of the external Umbraco packages are also ready for the Umbraco 9 release (H5YR!).
Bonus tip!
If you want to dive a bit deeper into the new changes in Umbraco 9, and want to get a more visual recap of them, I suggest watching the great Codegarden talk by Umbraco 9 team lead Bjarke Berg and developer Elitsa Marinovska “Umbraco 9 - The next major version” 👇