Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Local installation using SQL Express and IIS Express

Steven Thewissen edited this page May 28, 2018 · 5 revisions

This is a step-by-step instruction for installing all the needed software to run Mynt locally on a Windows client or server using SQL Server Express and IIS Express. If you run into problems there is a YouTube video which explains the process in a bit more detail. Microsoft also wrote an article on publishing to IIS which you can find here.

Prerequisite - Install IIS Express and SQL Express

Download the latest versions of both of these tools from the links above and install all of them. Follow the instructions on the screen to complete the installation process.

IIS Express Server

On Windows Server operating systems the process is different because you have to enable the Web Server (IIS) server role and establish role services.

  1. Use the Add Roles and Features wizard from the Manage menu or the link in Server Manager. On the Server Roles step, check the box for Web Server (IIS).

server-roles-ws2016

  1. After the Features step, the Role services step loads for Web Server (IIS). Select the IIS role services desired or accept the default role services provided.

role-services-ws2016

Prerequisite - Install .NET Core or .NET Framework 4.7.1

The solution can be run on either one of these. Download the one you want to use and install it. Follow the instructions on the screen to complete the installation process.

Quick and dirty .NET Framework 4.7.1 installation

You also can install it directly from within Windows:

  • Go to Start > Control Panel > Activate or deactivate Windows features
  • Select .NET Framework 4.7 Advanced Services

Create a site in IIS Express

Note: The physical path has to be your folder with the publish output.

  1. On the hosting system, create a folder to contain the app's published folders and files.

  2. Within the new folder, create a logs folder to hold ASP.NET Core Module stdout logs when stdout logging is enabled. If the app is deployed with a logs folder in the payload, skip this step. For instructions on how to enable MSBuild to create the logs folder automatically when the project is built locally, see the Directory structure topic.

  3. In IIS Manager, open the server's node in the Connections panel. Right-click the Sites folder. Select Add Website from the context menu.

  4. Provide a site name and set the physical path to the app's deployment folder. Provide the Binding configuration and create the website by clicking OK: add-website-ws2016

Create a database in SQL Server Express

Just add an empty database to your SQL Server Express instance. This guide assumes you've named it Mynt. You can leave the database empty because Mynt will take care of setting up the tables as soon as it is up and running.

Prepare the solution for use with SQL Server Express

To use SQL Server Express you first need to add a reference from the Mynt.AspNetCore.Host project to the Mynt.Data.SqlServer project. By default Mynt uses Azure Table Storage which is why the reference to SQL Server isn't there at first. The second step is to change your Startup.cs file:

Remove or comment out the line:

.AddSingleton<IDataStore, AzureTableStorageDataStore>() .AddSingleton(i => Configuration.GetSection("AzureTableStorageOptions").Get<AzureTableStorageOptions>())

And add the following line:

.AddSingleton<IDataStore, SqlServerDataStore>() .AddSingleton(i => Configuration.GetSection("SqlServerOptions").Get<SqlServerOptions>())

This tells Mynt that when it needs a data store it should use SQL Server.

Add a connection string to your SQL Server Express database

Open the appsettings.json file in the Mynt.AspNetCore.Host project. There should be a section in there called SqlServerOptions. If there is not simply copy the section below and paste it into the file.

"SqlServerOptions": { 
    "SqlServerConnectionString": "Data Source=.\\YOUR_SQL_SERVER_NAME;Initial Catalog=Mynt;Integrated Security=True;MultipleActiveResultSets=True"
}

Replace YOUR_SQL_SERVER_NAME with your SQL Express Server's name. Adjust the Initial Catalog to the correct value if you did not name your database Mynt.

Publishing

In Mynt.AspNetCore.Host you can choose between two modes. <TargetFrameworks>netcoreapp2.0;net471</TargetFrameworks>

  1. To edit this you have right click the Mynt.AspNetCore.Host project and then click Properties.

  2. Choose one of them but you can run both target frameworks on Windows.

  3. The easiest way to deploy is to right click on Mynt.AspNetCore.Host and click Publish. Select your target folder. You may have to create a profile which includes the target folder.

1