Litium is installed via a Nuget feed in Visual studio. You can install Litium without the Accelerator but in this tutorial we’ll take a look at installing Litium and Litium Accelerator.
The Litium Accelerator is a pre-packaged Litium site which speeds up the development when starting new projects. It is delivered as source-code and you have the possibility to change what you need.
When this post is written the latest version of Litium is 7. The development environment system requirements are at the time:
- Visual Studio 2017 running with elevated permissions (other versions may work but have not been tested. I’m using VS2019).
- IIS 7 or later with the Web Sockets protocol enabled.
- .NET Framework 4.7.2 Developer Pack.
- Access to Litium NuGet feed. To get access you need an account at Litium Docs.
- Microsoft SQL Server 2016 or later with database compatibility level 130.
This and more information can be found at the System requirements of the Litium docs.
1. Downloading Litium Accelerator
At this point I assume you’ve installed the IIS and the .NET framework, the nuget feed, and has created an account that has got download rights for the accelerator. (Linked to in the System Requirements above).
Go to Litium docs - Download and download the accelerator. If you have access to it the package will show up at the top at Latest accelerators. At the time the latest version is Litium Accelerator 7.2.3.
Extract the .zip into a folder where you want to work with the solution.
2. Install via Visual Studio
- Open Accelerator.sln after extracting the package.
- Go to View -> Other Windows -> Package Manager Console and run the command Update-Package -ReInstall
- Wait for install to complete (This took around 3 minutes for me).
If you, like me, got an error saying: “Update-Package : Some NuGet packages are missing from the solution. The packages need to be restored in order to build the dependency graph. Restore the packages before performing any operations” Make sure you’ve set up the nuget feed correctly and click the restore button that has shown up at the top of the package manager console. (I had recently changed passwords to my account and needed to update it to get it to work)
3. Configuring the Accelerator
Now right click on the Litium.Accelerator.Mvc-project in the Solution Explorer and click on Set as startup project and run the project.
When the site has started we are redirected to the login page. Login with your windows account (ex: DOMAIN\[email protected] or .\Crille)
Then click on the Cogwheel (top right) -> Deployment -> Accelerator
Select a name and a domain name for the site. I’m using accelerator.localtest.me in this case. By choosing a localtest.me-domain I do not need to add anything to the hosts-file.
Check the Create a set of example products and categories checkbox and the click Import. This will give us some example data.
4. Moving database to Sql Server
By default the accelerator uses a LocalDb instance. Lets move that db to a MSSQLServer instance.
Open Microsoft SQL Server Management Studio as an administrator then right click on Databases and select Attach…
Then click on Add… and select the .mdf -file that is located in the Litium.Accelerator.Mvc/App_Data folder.
Then click ok and attach the database.
When this is done you need to update the FoundationConnectionString in web.config to point to your MSSQL-Instance instead (Not covered here).
5. Adding an IIS site
Next fire up the IIS and right click on Sites and then on Add Website… and select a name.
Point the Physical path to \Src\Litium.Accelerator.Mvc and add the hostname you selected. (in my case http://accelerator.localtest.me/)
You might need to run the Application pool as your local user to get access to the database. But I’ll leave the iis-configuration up to you.
Now browse to the site and you should end up with something like this: