Orchard Core runs on .NET5. Microsoft developers can develop Orchard Core Websites using .NET5 and C# 9.

Orchard Core .NET5 and C# 9

If you're a freelance Microsoft developer such as myself and have the pleasure of working on a lot of new projects that can be developed using .NET5 and C# 9, you'll love the fact that Orchard Core now supports multi-targeting and can target the .NET5 framework. This allows Orchard Core developers to use the new features in .NET5 as well as the new language features in C# 9 for their Orchard Core websites! This is great news for me in particular as I develop a lot of websites using ASP.NET Core Razor Pages and ASP.NET Core Web API's using .NET5 and C# 9, and it's nice to be able to focus on a single framework and language version.

Well after .NET5 was released, Orchard Core only supported .NET Core 3.1. If you were to create a new Orchard Core website from scratch and view the project file, you would see that indeed the Orchard Core website targeted .NET Core 3.1.

<PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    ...
</PropertyGroup>

In the latest pre-release of Orchard Core, Orchard Core developers now have the option of targeting .NET Core 3.1 or .NET5. There are numerous ways to specify that Orchard Core target .NET5, but the easiest way is to use the code generation tools and specify the .NET5 framework when creating the Orchard Core website using the Orchard Core project templates.


$ dotnet new occms -n Web -fm net5.0

Although the Orchard Core documentation suggests that Orchard Core will target .NET Core 3.1 by default, I haven't experienced that in my development. When I create a new Orchard Core CMS website from scratch and do not specify the framework, it also defaults to using .NET5.


$ dotnet new occms -n Web

It may be that the Orchard Core documentation needs to be updated, but to ensure your Orchard Core website targets .NET5 just check the project file.

<PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    ...
</PropertyGroup>

As a freelance .NET developer, you can now focus all your development efforts on the .NET5 framework and C# 9 to develop Orchard Core websites, ASP.NET Core Razor Pages websites, ASP.NET Core Web API's, and Blazor apps!