Try our conversational search powered by Generative AI!

Mark Hall
Aug 4, 2021
(6 votes)

Starting a new project - .NET 5 Series, Part 2

Introduction to Optimizely .NET 5 Series

Welcome everyone to a series of posts about the upcoming releases of .Net 5 compatible commerce and content clouds.

Getting started with upgrade-assistant

Starting a new project

Working with docker and containers


Welcome everyone to the second post in a series of posts about the upcoming releases of Optimizely .Net 5. In this post we will explore starting a new project.  Optimizely Content and Commerce clouds have always been relatively easy to setup a new project, and .Net 5 is no different.  Lets take a look at whats changed compared to full framework. 

Install Tools

When working with .Net 5, Microsoft provides tools to create and manage .Net 5 applications. These tools are actually .Net 5 applications themselves, which allow them to run on all operating systems.  In the full framework version, Optimizely relied on Visual Studio extensions and visual studio powershell to install new projects and update schema.  This of course will not work in .Net 5 because Visual Studio is not available on all the operating systems that can run .Net 5 applications.  

 dotnet new -i EPiServer.Net.Templates::1.0.0-pre-020039 --nuget-source --force
 dotnet tool install EPiServer.Net.Cli --global --add-source --version 1.0.0-pre-020034

(Note please use the beta feed for the preview packages until they are pushed to the normal Optimizely feed.)

Understanding the tools

The first tool we are installing are Optimizely project templates.  .Net 5 allows the developers the abiility to create a new project template using the dotnet new command.  There are many templates out there to help scaffold different types of .Net 5 applications.  For Optimizely, we provide empty cms and empty commerce projects.

The second tool is the Optimizely CLI tool.  This is a tool for creating database and database users as well as updating connection strings in appsettings.json.  It is important to note that this tool does not install any schema, it just creates the database and the user.  The schema is auto installed for the connection string if it does not find the schema it needs to run the application.

Creating the project

If the run command fails with missing assembly add beta feed package source to nuget.config on the root of the project folder and rerun.

Lets create a new cms project.

dotnet new epicmsempty --name ProjectName
cd projectname
dotnet-episerver create-cms-database ProjectName.csproj -S . -E 
dotnet run

Now lets create a new commerce project.

dotnet new epicommerceempty --name ProjectName
cd projectname
dotnet-episerver create-cms-database ProjectName.csproj -S . -E
dotnet-episerver create-commerce-database ProjectName.csproj -S . -E --reuse-cms-user
dotnet run


If you prefer to start with one of the foundation projects we have .Net 5 branches available.  These branches will move to develop once the software is General Availabiility.



Closing Thoughts

Getting started with a new Optimizely project is as easy as ever.  It is even easier for the non windows users who used to struggle with virtual machines to run the software locally.  With the cross plaform capabilities it is now possible to develop on your favored operating system.  In a future post we go a step further and explore how we leverage containers to run Optimizely.

Aug 04, 2021


Johnny Mullaney
Johnny Mullaney Aug 6, 2021 02:19 PM

Delighted to see  .Net Core Optimizely get so much momentum this year. Well done all!

Please login to comment.
Latest blogs
Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog

The A/A Test: What You Need to Know

Sure, we all know what an A/B test can do. But what is an A/A test? How is it different? With an A/B test, we know that we can take a webpage (our...

Lindsey Rogers | Apr 15, 2024

.Net Core Timezone ID's Windows vs Linux

Hey all, First post here and I would like to talk about Timezone ID's and How Windows and Linux systems use different IDs. We currently run a .NET...

sheider | Apr 15, 2024