Developing Orchard Core CMS Applications on Linux using VS Code
Developing-Orchard-Core-CMS-Applications-on-Linux-Using-VSCode.pdf
Another option when developing Orchard Core application is to use Linux and VS Code. VS Code is a lightweight IDE (Integrated Development Environment). It’s also a cross platform IDE running on Linux, macOS, and Windows. It has all the popular features of an IDE like intellisence, debugging, built-in Git and most importantly extensions.
Browse to the URL: https://code.visualstudio.com/download Click on “.deb Debian Ubuntu” button to download the package. Switch to the Downloads directory.
cd ~/Downloads
Run the command:
sudo dpkg -i code_1.41.1-1576681836_amd64.deb
Browse to the web page Debian 10 Package Manager - Install .NET Core at:
Debian 10 Package Manager - Install .NET Core
Run the commands:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/debian/10/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list
Note: After installing the .NET SDK, it seems it’s not necessary to install the runtimes.
Run the commands:
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.0
Run the commands
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install aspnetcore-runtime-3.0
Run the commands
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-runtime-3.0
Orchard Core Templates uses dotnet new template configurations for creating new websites, themes and modules from the command shell. More information about dotnet new can be found at:
dotnet new template configurations
Run the command:
dotnet new -i OrchardCore.ProjectTemplates::1.0.0-rc1-*
This will use the most stable release of Orchard Core. In order to use the latest dev branch of Orchard Core, the following command can be used:
dotnet new -i OrchardCore.ProjectTemplates::1.0.0-rc1-* --nuget-source https://www.myget.org/F/orchardcore-preview/api/v3/index.json
Once the .NET Core SDK has been installed, the templates can be used for creating Orchard Core web applications
Switch to your projects folder. Mine is located at ~/Documents/GitHub
cd ~/Documents/GitHub
Run the commands:
mkdir MyOrchardCoreCMS
cd MyOrchardCoreCMS/
dotnet new occms -lo none
code .
Click the plus file icon on MYORCHARDCORECMS folder to create a new file.
Paste in the contents for the NuGet.config file. NuGet.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Orchard Core Preview Feed" value="https://www.myget.org/F/orchardcore-preview/api/v3/index.json" />
</packageSources>
</configuration>
Click on the Debug icon.
Click the "create a launch.json file".
Select .Net Core
Click on the green triangle to start running the application.
Application is running.
Launch the web browser and set the URL to:
Congratulations Our Orchard Core Application is running on Linux. Enter the site name, Blog for the Recipe, your Default Time Zone, Sqlite for the database and then your administrator credentials.
Now browse to the dashboard at:
Login with your admin credentials.
With ASP.NET and Orchard Core CMS you can setup the development environment and create an application in minutes on Linux, macOS, or Windows machine using VS Code. Best of all it’s all free.
The complete source code is located here.