Use App_Data/CommandLineOverride.xml to persist Core server command-line settings across application-package upgrades. This is for administrators who run MDriven Server or MDriven Turnkey Core locally, behind IIS, or behind a reverse proxy.
What the override file does
When a Core application finds App_Data/CommandLineOverride.xml in its application directory, it reads the XML and uses each <arg> value as a command-line parameter.
This lets you keep environment-specific startup settings outside the application package. For example, you can unzip a new server version over the existing application location while retaining the override file and its settings.
Create the file
- Open the application directory for the Core application you are configuring.
- Create the
App_Datadirectory if it does not already exist. - Create a file named
CommandLineOverride.xmlin that directory. - Add a
<root>element and one<arg>element for each setting. - Restart the application after changing the file.
For an IIS installation, the file is located below the IIS site folder. For example, an MDriven Turnkey site installed in C:\inetpub\wwwroot\MDrivenTurnkey uses:
C:\inetpub\wwwroot\MDrivenTurnkey\App_Data\CommandLineOverride.xml
XML format
The file must be well-formed XML. Put one parameter, without the leading hyphen, in each <arg> element.
<root>
<arg>port=5020</arg>
<arg>nohttps</arg>
<arg>host=localhost</arg>
<arg>iis=https://localhost/TKDebug</arg>
<arg>pathtoapp=/TKDebug</arg>
</root>
Do not copy // comments into this file: they are not valid XML. If you need to document a setting in the file, use an XML comment.
<root>
<!-- Use these settings only for a local development start. -->
<arg>port=5020</arg>
<arg>nohttps</arg>
<arg>host=localhost</arg>
</root>
Settings shown in the example
| Setting | Use | Example |
|---|---|---|
port
|
Sets the port used when the application runs directly. Use a port that is available on the host. | <arg>port=5020</arg>
|
nohttps
|
Starts without HTTPS. This is intended for local development where certificate setup is not wanted. Remove this setting when the application must use HTTPS directly. | <arg>nohttps</arg>
|
host
|
Sets the host value for a direct local start. | <arg>host=localhost</arg>
|
iis
|
Supplies the IIS URL used to host the application. The URL must match the URL configured in the IIS site binding. | <arg>iis=https://localhost/TKDebug</arg>
|
pathtoapp
|
Declares the sub-URL path that the application filters away. Use it when a reverse proxy, such as nginx, publishes the application below a path base. | <arg>pathtoapp=/TKDebug</arg>
|
Choose a configuration
Local development
Use direct-host settings when you start the application locally and do not need HTTPS:
<root>
<arg>port=5020</arg>
<arg>nohttps</arg>
<arg>host=localhost</arg>
</root>
For background on running local Core servers and the use of nohttps, see Documentation:LocalServers.
IIS hosting
When IIS hosts the application, set iis to the same URL that you configured in the IIS binding. For example, if the binding exposes the application as https://localhost/TKDebug:
<root>
<arg>iis=https://localhost/TKDebug</arg>
</root>
Follow the complete site, application-pool, permissions, binding, and connection configuration in Documentation:Deploying MDriven Server & Turnkey Core on IIS. If you configure MDriven Turnkey, its connection to MDrivenServer is configured separately in MDrivenServerOverride.xml.
Reverse proxy below a subpath
If a reverse proxy publishes the application below a subpath, include that path with pathtoapp. For an application published below /TKDebug:
<root>
<arg>pathtoapp=/TKDebug</arg>
</root>
The path begins with /. This setting corresponds to the path base that the application filters away.
IIS hosting model
From 2024-11-29, Core builds use <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>. Under this model, IIS starts the application as an external process and acts as its reverse proxy.
This supports hosting multiple applications in one Azure WebApplication. The standard arrangement places MDriven Turnkey at the top-level path and MDrivenServer below __MDrivenServer. Configure the URL and application paths consistently with the IIS bindings and deployment layout.
Troubleshooting
| Symptom | Check |
|---|---|
| The application does not use the expected settings. | Confirm the file is named exactly CommandLineOverride.xml and is located in the application's App_Data directory. Restart the application after editing it.
|
| The application fails after adding the file. | Validate the XML. In particular, replace // annotations with <!-- XML comments --> or remove them.
|
| An IIS-hosted application is unavailable at its expected URL. | Confirm that the iis URL exactly matches the IIS site binding, including protocol, host, and path.
|
| A proxied application does not handle its subpath correctly. | Confirm that pathtoapp matches the path base exposed by the reverse proxy, such as /TKDebug.
|
