Tuesday, 24 November, 2020

Umbraco Basics – Detailed NuGet Installation Instructions for Umbraco 7

As part of my Umbraco Basics series I explain how to install Umbraco using NuGet.

Overview

When you first start developing with Umbraco even the little things can seem strange and confusing.

Previously I've explained how to install Umbraco using the pre-compiled, downloadable, zipped installation file-set. In this new article I explain an alternative method: using the Umbraco NuGet package.

In this post creating an ASP.NET MVC Umbraco 7.10.1 project using Visual Studio 2017 on a Windows 10 machine and IIS Express.

I assume you’ve never installed Umbraco before and have limited knowledge of Umbraco.

Related posts

You may also be interested in reading these posts.

Prerequisites

  • Microsoft Visual Studio 2015 or higher; the Community Edition is fine.
  • IIS 7+; The version of IIS Express which ships with Visual Studio 2015 is fine.
  • SQL Server 2014+. SQL CE (Compact Edition) will work too but is not recommended; Azure SQLServer is okay too but not explained here.

Optional Extra Tools

  • SQL Server Management Studio:: A free SQL Server management tool free from Microsoft. Download it from the Microsoft download centre.

Creating the Web Project

First, to create an empty Asp.NET MVC website Project, follow these steps:

1) Launch Visual Studio.

enter image description here

2) Select File > New > Project. Select Asp.NET Web Application (.NET Framework); and enter your project name, folder location.

Side Note: I used .NET Framework 4.6.1. The latest versions of Umbraco recommend 4.7.2.

enter image description here

3) Click OK and create the project.

4) Build and run the project (optional).

Installing Umbraco Using NuGet

Now you have a working ASP.NET MVC Website. It's time to add Umbraco.

1) Open the Package Manager Console ( View > Other Windows > Package Manager Console ).

Package Manager Window

2) Type: Install-Package UmbracoCms

3) When prompted whether to overwrite the Global.asax, enter Y, hit return.

Prompt

4) Umbraco is now installed. Build the project (F7) and run it (F5).

Side note: If you view the markup for the overwritten Global.asax it will now inherit from Umbraco.Web.UmbracoApplication to hook up to the Umbraco core. The code and routing defined in Global.asax.cs derived from System.Web.HttpApplication will not be run. You can test this by setting a break point on the Application_Start function. You may wish to clean up and remove this unused code.

Create the Umbraco Database

After, or maybe even while, installing Umbraco you'll need to set-up the database. Umbraco offers four different database engines to choose from:

  • SQL CE : SQL CE (Compact Edition) is easy to set-up and fine for testing but not really suitable for a true website. If installing SQL Server seems like overkill you can always install using SQL CE and optionally upgrade to an SQL Server later on - just amend the connection string in web.config to point to the new server and database.

  • SQL Server (recommended): SQL Express and Developer editions are freely available on Microsoft's website and fairly painless to install.

  • SQL Azure: SQL Azure is a fine choice but requires an Azure account with an SQL Server and database set-up for Umbraco. This isn't something I'm going to cover in this post.

  • MySQL ( not recommended): MySQL isn’t recommended and probably won’t work without considerable tinkering. If you're looking at a Linux set-up then maybe consider Microsoft's SQL Server for Linux.

Assuming you decide to go with SQL Server you'll need to:

1) Create a database on the server.

  • Create a new database using Visual Studio by selecting View > SQL Server Object Explorer, then select Add SQL Server to connect to your server and manage it [you may need to supply some credentials for remote servers); right click on databases to add new databases.
  • Alternatively, if like me you don't like Visual Studio's SQL Server tools, you can use Microsoft's SQL Server Management Studio to create the database instead (as shown below):

MSMS

2) Provide Umbraco with the Server name, database name and access credentials. I use Windows authentication on development machines. You'll see how you do this in the next section.

Configure Umbraco

Once you've built and run Umbraco you'll be presented with a configuration screen. Provided you've set-up the database in the last step you're ready to go and fill in the form.

Umbraco config form

Fill in your username, email and password and then Click Customise.

Umbraco customise form

Select Microsoft SQL Server and enter your server's IP address or URL, and the name of Umbraco Database you created earlier.

If working on development machine with SQL Server select Integration Authentication; If working with a remote SQL Servers provide the SQL Login and Password Credentials.

Click Continue.

When asked. create a machine key (click Continue). This important for cloud based environments.

Optionally install the start website (recommended for newbies). Umbraco Starter Kit

Side note: The connection string for the database settings maybe changedlater in the web.config file.

Once the above steps are completed and Umbraco connects to the SQL Server Database it will create all the required database tables on your new database and display the Umbraco backoffice. The backoffice is Umbraco's admin portal where you can create and modify the website. The front end of your website is accessible by removing the /umbraco suffix to the URL.

Summary

Congratulations, you should now have a working Umbraco installation. The installation process takes you through to the backoffice, uou can view the website, not the admin portal, by removing the /umbraco segment from the browser's URL.

The CMS web application runs and works like any other ASP.NET application, you can debug it, deploy it, just as you would any other ASP.NET application.

Want to Thank Me?

Did you like this article? Was it helpful? Why not buy me a coffee on Paypal? Buy me a coffee?