...
Create Solution
Lynicon ASP.Net Core currently runs only on the full targets .Net framework4. An ASP6 or .Net Core on Standard 1.6 (which works with .Net Core version will be developed in the near future.)
Info |
---|
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 on full , choose 'ASP.Net Core Web Application (.Net Core)' below for an application running on .Net , do the following:
Select Core, or 'ASP.Net Core Web Application (.Net Framework) as the project type.for an application running on full .Net 4.6. The subsequent steps are all the same regardless of what platform you choose here.
Warning |
---|
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 Applicatin Application template. Ensure the Authentication choice is No Authentication as this package sets up its own ASP.Net Identity based membership system.
...
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 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.
...
Now build the site so that you can use the output executable to run setup commands.
Run Command to Initialize Project
Find the folder in which the output executable from the build project is found e.g. something like C:\Dev\MyProject (or according to solution structure, C:\Dev\MySolution\src\MyProject\bin\Debug\net452\win7-x64).
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 <project name>.exe "dotnet run lynicon initialize-project" e.g. as underlined above. This . 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. If 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.
...
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:
Build the Site
Run a build on the site to update it with the changes made by the initialize-project command.
Run the Initialize-Database command
Go back to the command window.
Run <project name>.exe "dotnet run lynicon initialize-database. This ". After building your project again, this will connect to the database with the connection string provided and set up the core tables Lynicon requires.
Disregard an error message produced by log4net, it will work without the configuration it needed in ASP.Net MVC which it is requesting be set up.
Run the Initialization-Admin Command
Run <project name>.exe "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.
...