Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Warning

If you want to use the default connection string to a local .mdf in App_Data set up by VS scaffolding, you will need to modify it so that:

  • You have 'Data Source=(LocalDb)\MSSQLLocalDB' (rather than something like 'Data Source=(LocalDb)\v11.0', so that the most up-to-date version is used)
  • You replace '|DataDirectory|' with the full path to the .mdf e.g. 'C:\\Sites\\MySite\\App_Data\\xyz.mdf' (so that the command lines tools for setup will be able to find the path correctly)

Build the Site

Run a build on the site as the commands you are about to run will load the current site's compiled code in order to enable them to execute, and they won't work without this step.

Build the Database

If you used the default connection string from the project scaffolding which points to an .mdf file in App_Data, you will need to ensure the database is created before running the initialization commands.

Image Added

These initialize and activate Entity Framework Migrations.

  • Enable-Migrations: this sets up the project for migrations
  • Add-Migration -Name Init: this creates the first migration to create the database with ASP.Net Identity tables set up
  • Update-Database: this runs the migration

Run the Initialization Commands

Image RemovedImage Added

Go to the Package Manager console.  Lynicon has installed Powershell commands to set up the CMS.  The commands to run (in this order) are shown in the image.  They are:

  • Initialize-LyniconProject: this inserts commands into the Global.asax.cs to run lynicon initialization, and into FilterConfig.cs to set up Lynicon's MVC script manager
  • Initialize-LyniconDatabase: this builds the core database tables needed for Lynicon
  • Initialize-LyniconAdmin: this creates an admin user for Lynicon with all the admin roles, allowing you to access the CMS editor and back end.  You have to supply a Password parameter ensuring that the admin password is never set to a default value.  The admin user's username is 'administrator' and the default email is 'admin@lynicon-user.com'

Warning

Ensure you only have one instance of Visual Studio running when you run these commands or they may fail

...