Setup procedure
Overview
The following article describes how to setup Sitefinity CMS to work with a standalone ASP.NET Core application as renderer.
You first install Sitefinity NuGet packages in an ASP.NET Core application. This enables the application to render ASP.NET Core pages and to serve as a Sitefinity CMS proxy for all other types of pages, created with Sitefinity.
PREREQUISITES: To setup and run the Renderer application:
- You must have installed ASP.NET Core SDK 5.0
- You must have upgraded your Sitefinity CMS to version 14.0 or above.
- Your Sitefinity license must include both your Renderer application domain (the frontend) and your Sitefinity CMS domain (the backend).
The following procedure describes how to setup Sitefinity CMS to work with the .NET Core Renderer application locally – when both applications are hosted locally. After you have ran and tested this scenario and you can move to a cloud hosting or a mixed hosting configuration. For more information see Hosting configurations.
Process
- You configure Sitefinity CMS to work with the .NET Core Renderer.
- You can run the quick setup, using the .NET Core CLI
OR
- You configure Sitefinity CMS to work with the .NET Core Renderer.
- You create an ASP.NET Core web application
- You install the NuGet packages
- You configure the .NET Core Renderer
- You run the Renderer
Configure Sitefinity CMS
After creating and configuring your ASP.NET Core application, you have to configure your Sitefinity CMS. Perform the following:
- In Sitefinity CMS backend, navigate to Administration » Web services.
- Open the Default web service.
- Under Who can access the content by this service?, select Everyone.
- Save your changes.
Quick setup procedure
Sitefinity comes with a .NET Core Sitefinity template which allows you to quickly setup your renderer and start experimenting with it. To do this, you use the .NET CLI that comes with the .NET Core SDK.
- Setup Sitefinity CMS, using the procedure above.
- Run the .NET CLI.
- Add Sitefinity NuGet source with the following command:
dotnet nuget add source https://nuget.sitefinity.com/nuget
- Install the template with the following command:
dotnet new -i Progress.Sitefinity.AspNetCore.Templates::*
- Create a new Renderer app with the following command:
dotnet new sitefinity --project-name "YourProjectName" --sfurl "http://your.sitefinity.url"
- Add a widget to your project with the following command:
dotnet new sitefinity-widget --widget-name "YourWidgetName"
- Start the renderer using the following command:
dotnet run
Create the ASP.NET Core web application
You install the Renderer in a separate ASP.NET Core application. If you do not have one, create it in the following way:
- In Visual Studio, navigate to File » New » Project…
- Click ASP.NET Core Web Application » Next.
- In Project name, enter Renderer and click Create.
- Make sure ASP.NET Core 5.0 is selected and click Create.
Install the NuGet packages
In your Renderer application, you must install the provided NuGet packages:
Progress.Sitefinity.AspNetCore.nupkg
Progress.Sitefinity.AspNetCore.Widgets.nupkg
Progress.Sitefinity.Renderer.nupkg
You need this package, if you want to customize the widget designers.
Progress.Sitefinity.RestSdk.nupkg
Perform the following:
- Save the provided NuGet packages in a folder on your computer.
- In Visual Studio, navigate to Tools » NuGet Package Manager » Package Manager Settings.
- Under NuGet Package Manager, click Package Sources.
- Add a new source, name it Sitefinity NuGet Repository, and, in Source field, enter https://nuget.sitefinity.com/nuget
- Click OK.
- Navigate to Tools » NuGet Package Manager » Manage NuGet Packages for Solution…
- In Package source dropdown, select Sitefinity NuGet Repository.
- Open the Browse tab, select Progress.Sitefinity.AspNetCore, and install it in project Renderer.
- Select Progress.Sitefinity.AspNetCore.Widgets and install it in project Renderer.
Configure the .NET Core Renderer
After you have created the project and installed the NuGet packages, you must configure it to connect it to Sitefinity CMS. In Visual Studio, perform the following:
- In the Solution Explorer on the right, select
appSettings.json
.
Edit the file to add the Sitefinity-related configurations.
The file should look in the following way:
- Select the
Startup.cs
file.
Edit the file to add the Sitefinity-related configurations.
The file should look in the following way:
- In the Solution Explorer on the right, expand Properties and select
launchSettings.json
.
- Find the object with property
"commandName": "Project"
and edit this object’s applicationUrl
property.
The property should look in the following way:
"applicationUrl": "https://localhost:5001;http://localhost:5000"
-
In Visual Studio toolbar, expand the run button dropdown, and select the launch profile you just edited.
In your case, it is named Renderer.
- Build your solution.
Run the Renderer
To run the renderer, navigate to https://localhost:5001/Sitefinity or http://localhost:5000/Sitefinity
NOTE: You use these URLs to run the Renderer locally for development purposes. To setup the Renderer for production, you can use on of the hosting scenarios, described in Hosting configurations.
Related videos
To setup the .NET Core application, use the following video:
For Sitefinity CMS setup, use the following video: