🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Faster prototyping with Turnkey
This page was created by Alexandra on 2018-10-17. Last edited by Wikiadmin on 2026-07-29.

You can run a MDriven Turnkey application on your own computer while you model in MDriven Designer, so you can test web views, data, and Turnkey assets without uploading to MDrivenServer; this workflow is for modelers and developers who need a short local feedback loop.

What local Turnkey prototyping does

Local Turnkey prototyping runs your model as a local web application. It is useful when the built-in WPF prototyper is not enough because you need to inspect the browser-based Turnkey user interface, test ViewModels, or change Turnkey assets such as CSS and page overrides.

The local prototype uses XML persistence. XML persistence stores prototype data in a file next to the model rather than using MDrivenServer. You can therefore model, save, refresh the browser, and continue iterating without a cloud upload.

For example, you can add a property to a ViewModel in MDriven Designer, save the .modlr file, and refresh the local Turnkey page to check how the changed view renders. You can also place a tkusercss.css file in the model's asset folder, save the model, and refresh to test the CSS locally.

Choose a local hosting method

Use IIS Express when it is available in your MDriven Designer installation. The supplied walkthrough describes it as the current local path. The IIS method remains useful when you already host local web sites in IIS or need an IIS-hosted local site.

Method Use it when What you need
IIS Express You want the shortest setup from MDriven Designer. IIS Express installed locally and the MDriven Turnkey download installed from the prototyping dialog.
Local IIS site You already use IIS locally or need to import the Turnkey package into IIS. Local IIS, IIS Management Services, Web Deploy for IIS, and the MDrivenTurnkey package.

Before you start

  1. Create or open a model in MDriven Designer. Save the model to a folder you control. For example: C:\temp\TurnkeyPrototyping\CarRental.modlr.
  2. Keep the model and its prototype files in a location where both your Windows user account and the selected local web host can read and write them.
  3. Use a current local MDriven Turnkey installation. In the IIS Express walkthrough, the Turnkey download button downloads and unpacks the application; refresh this installation regularly so you do not test with an old local copy.

Start Turnkey with IIS Express

IIS Express is the preferred local-prototyping route described in the MDriven Designer walkthrough.

  1. Start MDriven Designer and open your saved model.
  2. Select the Play button and choose the local Turnkey prototyping option.
  3. Check the IIS Express status. If IIS Express is not installed, MDriven Designer directs you to installation information from Microsoft. Install IIS Express, then return to MDriven Designer.
  4. Download or refresh MDriven Turnkey from the same dialog. The dialog shows the location where the local application is installed.
  5. Select Start MDriven Turnkey on IIS Express. A command window opens for IIS Express and a browser opens the local application.
  6. Select the option to run the model and continue modeling, if shown, then work in MDriven Designer as normal.

Save the model after each modeling change. IIS Express detects the changed model file; refresh the browser to load the changed application. This is the core local round trip: change the model → save → refresh the web page → inspect the result.

Verify shared prototype data

The local web application and the WPF prototyper can use the same XML-persisted prototype data when they run against the same model.

  1. Create or change a value in the WPF prototyper and save it.
  2. Open or refresh the corresponding local Turnkey view.
  3. Confirm that the changed value appears in the browser.
  4. Change a value in the browser and save it.
  5. Reload the model data in the WPF prototyper to confirm that it sees the browser change.

If two browser windows point to the same local application, a change made in one can appear in the other after a short interval; refresh when you need to see the change immediately.

Start Turnkey as a local IIS site

Use these steps when you want to host the downloaded MDrivenTurnkey package in local IIS.

Install the prerequisites

  1. Install local IIS.
  2. In Windows features, add Management Services for IIS.
  3. Install Microsoft Web Deploy for IIS. Web Deploy provides the IIS import/export application menus used to import the Turnkey package.
  4. Download MDrivenTurnkey from the MDriven download page.

Import the Turnkey package

  1. Open IIS Manager.
  2. Use Import Application and select the downloaded MDrivenTurnkey ZIP package.
  3. Give the imported application a site or application name.
  4. Record both values displayed by IIS:

HTTP is sufficient for this local prototype. Do not spend time configuring HTTPS for this scenario.

Connect MDriven Designer to the IIS site

  1. Start MDriven Designer and open the saved model.
  2. Select Play, then select Local TurnkeyPrototyper.
  3. Enter the local IIS URL and the physical site-root path recorded from IIS.
  4. Select Start system.
  5. Select Run Model and continue modeling.

The local Turnkey site now runs the selected model without relying on MDrivenServer and stores XML-persisted data beside the model.

Add local Turnkey assets

A Turnkey asset folder has the same base name as the model and ends in _AssetsTK. For a model named CarRental.modlr, create this folder beside the model:

C:\temp\TurnkeyPrototyping\CarRental_AssetsTK

Local Turnkey mirrors this folder into the local site. Use it to iterate on assets such as directives, controls, page overrides, and CSS.

Example: test custom CSS

  1. Create CarRental_AssetsTK beside CarRental.modlr.
  2. Create a Content subfolder.
  3. Add tkusercss.css:
C:\temp\TurnkeyPrototyping\CarRental_AssetsTK\Content\tkusercss.css
  1. Save the model in MDriven Designer. Saving triggers Turnkey to reload its internals and mirror the assets.
  2. Refresh the local web page and inspect the CSS change.

Use this same loop for a ViewModel change: change the ViewModel, save the model, then refresh the browser. Keep the model and its _AssetsTK folder together so the local prototype can find and mirror the assets.

File permissions: the common startup problem

If local IIS prototyping does not start or cannot load the model, check file permissions before changing the model or Turnkey configuration. Two access directions are required:

Location Must be accessible by Why
Local Turnkey site root The Windows account that runs MDriven Designer MDriven Designer must update the local site files.
Folder that contains the .modlr file The IIS application-pool account, commonly IIS_IUSRS The local Turnkey site must read and write the model and XML-persistence files.

To correct the issue for a local IIS site:

  1. In File Explorer, open Properties for the IIS site-root folder, then open Security. Grant the account running MDriven Designer access to the site files.
  2. Open Properties and Security for the folder containing the model. Grant IIS_IUSRS the required access; the original local-prototype procedure uses Full Control for this account.
  3. Start the local prototype again.

Grant these permissions only to the local development folders involved. Do not apply broad permissions to unrelated folders.

Work with more than one model

You can keep several .modlr files in one directory and use the same local Turnkey installation for them, one model at a time. This makes it practical to switch between small prototype models without creating a separate Turnkey site for each model.

For example, keep CarRental.modlr and Inventory.modlr in C:\temp\TurnkeyPrototyping. Start the local prototype for CarRental, then select Inventory when you need to test that model. Each model can have its own matching _AssetsTK folder.

Move from local prototype to a hosted Turnkey site

Local prototyping is for rapid iteration. When the model and assets are ready for shared or hosted use, upload the model to a normal Turnkey environment. The evolved database and mirrored assets can then be used in the multi-user environment.

Review Documentation:Turnkey and Documentation:Starting with MDriven Turnkey for Turnkey setup and hosted-site guidance. If you need to debug local Turnkey generic code or configure a local model path through MDrivenServerOverride.xml, follow HowTos:Debug Turnkey Generic Code rather than changing the prototype workflow described here.

See also