This subject shows how to create a new site running Lynicon ASP.Net Core in Visual Studio 2015.
Create Solution
Lynicon ASP.Net Core targets .Net 4.6 or .Net Standard 1.6 (which works with .Net Core)
If you can't see the ASP.Net Core project types below, you'll need to install .Net Core tools from the web.
To set up an ASP.Net Core website, choose 'ASP.Net Core Web Application (.Net Core)' below for an application running on .Net Core, or 'ASP.Net Core Web Application (.Net Framework) for an application running on full .Net 4.6. The subsequent steps are all the same regardless of what platform you choose here.
Do not call the new Solution or Project 'Lynicon' (or Lynicon.Base or any other such name) as it will cause assembly linking problems
You'll now see the following window:
Choose the Web Application template. Ensure the Authentication choice is No Authentication as this package sets up its own ASP.Net Identity based membership system.
Install Lynicon
Before installing Lynicon, you should ensure certain dependencies in your project are sufficiently up to date not to clash with Lynicon's dependencies.
Edit the project.json file if necessary to ensure Microsoft.AspNetCore.Mvc is at least version 1.1.1, Microsoft.AspNetCore.Routing is at least 1.1.0, and Microsoft.Extensions.Logging is at least 1.1.0. If you are using the full .Net platform, ensure the framework specified includes "net46" at least. When you save this file, Visual Studio will automatically restore packages.
Now install Lynicon. Find it in the Nuget Gallery on nuget.org
Choose the LyniconANC package.
Set up Lynicon commands
Now add a line of code that will enable you to use the executable which normally runs the Kestrel webserver with your site to run Lynicon service and setup commands:
Add the highlighted line of code above into your Program.cs file in the root of your project.
Run Command to Initialize Project
Find the folder in which the project is found e.g. something like C:\Dev\MyProject (or according to solution structure, C:\Dev\MySolution\src\MyProject).
Open a Visual Studio developer command window as Administrator (right click the menu item and choose Run as Administrator).
Move (cd) to this directory, and then using the dotnet CLI, run the command "dotnet run lynicon initialize-project" e.g. as underlined above. First this will build your project. Then this tells your project executable to run a command to download new files and update existing ones in your project. This command makes a number of changes to the Startup.cs file. This will work with the Startup.cs file provided with the template we have used to create this project in these instructions. It should work with most customised Startup.cs files, especially if you follow standard C# formatting, but it is not guaranteed to work. You can check all its operations succeeded by inspecting its output, at the top it describes whether it succeeded in modifying files, then it lists all the files it has downloaded into your project. If you have problems, refer to the page which describes the changes you need to make to the Startup.cs file. If the command fails altogether, you can follow the steps to manually initialize the project.
Leave the command window open after this as you will need it later.
Set the Connection String to the Database
Determine a SQL database locally or remote which will host the content and user data. In appsettings.json, set the value for the connection string in the configuration section which has been created by the initialize-project command:
Run the Initialize-Database command
Go back to the command window.
Run "dotnet run lynicon initialize-database". After building your project again, this will connect to the database with the connection string provided and set up the core tables Lynicon requires.
Run the Initialization-Admin Command
Run "dotnet run lynicon initialize-admin <admin password>" (use your own password in place of m1pAssw0rd!). This sets up the admin user with the supplied password. Lynicon does not create a default admin user to avoid the scenario where this user is left with their default password causing a major security risk.
Confirm the output from this command looks as below:
You are now ready to use Lynicon CMS.
First Run
If you now run the site and log in as the administrator on /lynicon/login you will be able to see the Lynicon pages as described in the User Manual. Lynicon is now ready to be used for CMS functions.
To now set up a basic content-managed model, route and view, consult the Hello World page.