Visual Studio templates for older versions of Umbraco

Hello all,

I’m getting back into Umbraco after a long break and my first project is to upgrade an Umbraco 8 project to v15.

I understand that the best way to do this is to upgrade to v10 and then to v15 (possibly via v13 & v14).

I’ve installed the .Net runtimes I’ll need for each version:

.NET SDKs installed:
  3.1.426 [C:\Program Files\dotnet\sdk]
  5.0.104 [C:\Program Files\dotnet\sdk]
  5.0.214 [C:\Program Files\dotnet\sdk]
  5.0.407 [C:\Program Files\dotnet\sdk]
  5.0.408 [C:\Program Files\dotnet\sdk]
  5.0.416 [C:\Program Files\dotnet\sdk]
  9.0.203 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

and I have installed the Umbraco Templates using dotnet new install Umbraco.Templates
and I was planning to create a empty Umbraco 10 project in Visual Studio using the template.
Is there a way to use an appropriate template for the v10 project because the only option I’m given is to use the .Net 9 runtime?

Thanks in advance,

Matt

A bit annoying, but you need to install the correct version of the templates. If you install it using dotnet new install Umbraco.Templates you will always install the latest (15.x.x) version of the templates. Use this:

dotnet new install Umbraco.Templates::10.8.9

Then create your new Umbraco project. When you want to create an Umbraco 13 project, install the latest Umbraco 13 template:

dotnet new install Umbraco.Templates::13.8.0

As far as I know, you cannot install multiple versions of the template and have the option to select the Umbraco version to install.

Also good to know:
Umbraco 13 is the last version to support Nested Content and Macro’s. So updating to 13 first is the best choice I think. Also, the backend extensions (angularjs) don’t differ much between 8 and 13, so upgrading is easier. Upgrading to 14+ is a different beast :smiley:

2 Likes

Great, thanks for this information.

So by installing a specific version of the templates it would remove any previous version?
I suppose that makes sense.

Is there any advantage to starting off a project with a template?
What I used to do was install Umbraco into my empty project using the Nuget package manager and that would let you choose which version to install by specifying the version number so I suppose that may be an easier option?

Thanks,

Matt

It should, otherwise just do a dotnet new uninstall and it’ll show a list of all installed templates and the command to uninstall them if required.

The template has for instance an appSettings.json and an appSettings.Development.json included with the most essential settings setup correctly. Also the Program.cs contains everything setup correctly. For a completely new, blank project I would always use the template.

1 Like

If you look at templates in general, I think they kinda assume that you want to install the most recent version, which as in your case, isn’t always the case.

As illustrated by your screenshot, there isn’t a good way to install an older version from the UI in Visual Studio. But as Luuk have already answered, you can install the template for a specific version of Umbraco.

If you want a bit extra help, I can recommend using Paul Seal’s Package Script Writer to generate the install commands for you, which then might save you a bit of time :wink:

1 Like