🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
Injecting the Core server command line parameters via file

The .NET Core builds of MDriven Server and MDriven Turnkey take their startup parameters from the command line, or from a file in the application:

App_Data/CommandLineOverride.xml

If the file exists, each <arg> in it is used as a startup parameter. The file stays in place when you unzip a new version of the program over the old one, so the application starts with the same settings after an update.

For how the Core builds run in general – Kestrel, IIS, reverse proxies – see How MDriven Core runs.

Parameters

Parameter Used by Meaning
iis=<address> Both The application runs behind IIS and is reached at this address, e.g. iis=https://myapp.example.com/__MDrivenServer. Use exactly the address of the IIS binding and application path. This is usually the only parameter needed on IIS.
port=<number> Both The port the built-in web server (Kestrel) listens on when the application runs without IIS – on Linux, macOS, in Docker or locally. Without it, MDriven Server listens on 5042 and Turnkey on 5050.
host=<name> Both The host name Kestrel listens on, e.g. localhost to accept local connections only.
nohttps Both Kestrel serves plain http. Use it when a reverse proxy in front of the application handles https, and for local development.
pathtoapp=<path> Both A path below the address that the application should handle as its own root, e.g. pathtoapp=/__MDrivenServer or pathtoapp=/MyApp. Use it behind a reverse proxy such as Nginx that forwards a sub-path to the application.

The programs also accept a few parameters that MDriven Designer uses when it starts local servers (see LocalServers); you do not normally set them yourself.

Examples

Behind IIS – MDriven Server below a Turnkey site:

<root>
  <arg>iis=https://myapp.example.com/__MDrivenServer</arg>
</root>

Without IIS, behind a reverse proxy – Kestrel on port 5010, plain http, the proxy handles https:

<root>
  <arg>port=5010</arg>
  <arg>nohttps</arg>
</root>

Locally for development:

<root>
  <arg>port=5020</arg>
  <arg>host=localhost</arg>
  <arg>nohttps</arg>
</root>

Use XML comments (<!-- … -->) if you want notes in the file. The zips contain an example as App_Data/CommandLineOverride - NotInEffect.xml, and App_Data/CommandLineOverrideForAzureWebApp.xml for Azure.

Hosting model on IIS

Since 2024-11-29 the Core builds run out-of-process in IIS (<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>): IIS starts the program as a separate process and only acts as a reverse proxy for it. This makes it possible to run several applications in one IIS site or one Azure Web App – for example Turnkey at the root and MDriven Server as __MDrivenServer below it, which is where Turnkey looks for its server by default (see MDrivenServerOverride).

See also