You use MDrivenServerOverride.xml to tell a Turnkey server which MDrivenServer to use, or to run Turnkey in standalone prototype mode while developing and debugging.
Configure the Turnkey-to-MDrivenServer connection
Place the file in the Turnkey application's App_Data directory:
App_Data/MDrivenServerOverride.xml
The file overrides the MDrivenServer location that Turnkey would otherwise use. A normal connection specifies the MDrivenServer URL as the element value and the password as the MDrivenServerPWD attribute.
<?xml version="1.0" encoding="utf-8"?>
<root>
<MDrivenServerOverride MDrivenServerPWD="thepwd">https://TheUrl</MDrivenServerOverride>
</root>
For example, a local Turnkey installation can connect to a local MDrivenServer at port 5000:
<?xml version="1.0" encoding="utf-8"?>
<root>
<MDrivenServerOverride MDrivenServerPWD="123456">http://localhost:5000</MDrivenServerOverride>
</root>
The password must match the MDrivenServer user password used by the connection. In a local server pair, the default CompactDB user is a with password 123456. LocalServers creates and maintains this configuration for local server pairs.
Choose the configuration that matches your scenario
| Scenario | Configuration | Result |
|---|---|---|
| Turnkey uses an MDrivenServer | Set the element value to the MDrivenServer URL and provide MDrivenServerPWD.
|
Turnkey obtains the model and data from MDrivenServer. |
| Turnkey built with .NET Core connects to an MDrivenServer built with .NET Framework | Add SkipSignalR="true".
|
Disables SignalR for this connection because the SignalR versions are incompatible. |
Prototype a local .modlr or .ecomdl model without MDrivenServer
|
Set PrototypeWithMDrivenDesignerInPath to the model file.
|
Turnkey runs alone with XML persistence and takes its model from the specified file. |
| Debug local CodeDress assemblies while using a stable MDrivenServer | Set CodeDressOverride to the directory containing the debug assemblies.
|
Turnkey loads CodeDress assemblies from that directory. |
Work around SignalR version incompatibility
When a server built with .NET Core connects to a server built with .NET Framework, their SignalR versions are incompatible. Disable SignalR on the Turnkey connection by adding SkipSignalR="true".
<?xml version="1.0" encoding="utf-8"?>
<root>
<MDrivenServerOverride MDrivenServerPWD="somepwd" SkipSignalR="true">https://SomeServer</MDrivenServerOverride>
</root>
Prototype without MDrivenServer
Use prototype mode when you want to inspect how a local model appears in HTML without uploading the model or evolving a database. Turnkey uses XML persistence and reads the model from the path you provide.
<?xml version="1.0" encoding="utf-8"?>
<root>
<MDrivenServerOverride PrototypeWithMDrivenDesignerInPath="C:\temp\dummy.modlr" CopyAssetsTKOnStart="True" />
</root>
PrototypeWithMDrivenDesignerInPath accepts a path to a .modlr or .ecomdl file. CopyAssetsTKOnStart="True" copies Turnkey assets when the prototype starts.
Prototype mode is intended for fast UI iteration. It does not provide server-side actions or true database behavior. Use a normal MDrivenServer connection when you need those behaviors. For the local-server and LocalTurnkeyPrototyper distinction, see Documentation:LocalServers.
Debug CodeDress with a stable MDrivenServer
Turnkey generic-code debugging can use a stable MDrivenServer while loading local CodeDress debug assemblies. Keep the model version in MDrivenServer the same as the model version in your local development environment.
<?xml version="1.0" encoding="utf-8"?>
<root>
<MDrivenServerOverride
MDrivenServerPWD="pwd for mdrivenserver user a"
CodeDressOverride="C:\PathToCodeDress_bin_Debug_assemblies">https://urltomdrivenserver/__MDrivenServer</MDrivenServerOverride>
</root>
In prototype mode, CodeDress looks for assemblies near the model rather than in ModelCodeAssemblies. The paths tried are bin/debug and ../bin/debug, relative to the model path.
When a small test model needs assets from another model, set ExternalAssetsTK to that model's AssetsTK directory:
<?xml version="1.0" encoding="utf-8"?>
<root>
<MDrivenServerOverride
PrototypeWithMDrivenDesignerInPath="C:\temp\DocComp\DocComp.modlr"
MDrivenServerPWD="somepwd"
ExternalAssetsTK="C:\Users\...\SomeOther_AssetsTK\" />
</root>
Use with reverse proxies and fixed application URLs
MDrivenServerOverride.xml controls the URL Turnkey uses to reach MDrivenServer. It does not set the public URL that an application uses for itself. If a load balancer or reverse proxy causes an application to detect the wrong own URL, configure HardServerUrl separately. HardServerUrl can also affect the Turnkey SignalR connection, so verify both settings when the application is hosted behind a proxy.
For Core-server host, port, HTTPS, IIS, and path-base settings, use CommandLineOverride.xml rather than this file.
