🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
Troubleshooting IIS application startup issues

What to do when MDriven Turnkey or MDriven Server does not start in IIS. The causes and the tools differ between the two builds – first check which one you run: the .NET Core build has an aspNetCore element in web.config and an application pool with No Managed Code; the .NET Framework build runs in a .NET CLR v4.0 pool.

Both builds

  • Read the application's own log first – see Logs. Turnkey logs which MDriven Server address it uses at startup.
  • Certificate problems stop MDriven Server, because it calls itself – see Certificates and HTTPS on IIS.
  • Folder permissions: the application pool user needs write access to the application folder – see AppPool user.
  • Turnkey cannot reach MDriven Server: check the server's address (default: Turnkey's own address followed by /__MDrivenServer, otherwise App_Data/MDrivenServerOverride.xml) and the password of the user a – see MDrivenServerOverride.
  • Windows Event Viewer → Windows Logs → Application often has the exact error.

.NET Core build

IIS starts the MDriven program and forwards requests to it through the ASP.NET Core Module – see How MDriven Core runs.

Error Usual cause What to do
HTTP Error 500.19 (configuration error, code 0x8007000d) IIS does not know the aspNetCore element: the ASP.NET Core Hosting Bundle is missing, or was installed before IIS Install the Hosting Bundle, or run its installer again and choose Repair. Check that AspNetCoreModuleV2 is listed under Modules in IIS Manager. Then run iisreset.
HTTP Error 502.5 (process failure) or 500.3x The program starts but stops at once – often a missing or wrong App_Data/CommandLineOverride.xml, missing permissions, or a port or certificate problem Turn on the startup log (below) and read it.
HTTP Error 503 The application pool is stopped – it has crashed several times in a row Read Event Viewer and the startup log, fix the cause, start the pool.
The app starts but links or callbacks go to the wrong address The address in CommandLineOverride.xml (iis=…) does not match how the application is reached Use exactly the address of the IIS binding, including https and the application path.

Turn on the startup log: in the application's web.config, set stdoutLogEnabled="true" on the aspNetCore element. The program's console output is then written to logs\stdout_*.log in the application folder (the logs folder must exist, and the application pool user must be able to write to it). Turn it off again when you are done – the files grow. See Microsoft's Troubleshoot ASP.NET Core on IIS.

Locked files when updating: the program files are locked while the application runs. Stop the application pool before you replace them. A PowerShell window that has opened MDriven Server's local database can also keep files such as amd64\sqlceme40.dll locked until the window is closed.

.NET Framework build

See the real error instead of the error page: Turnkey's web.config maps common 4xx errors to a ViewModel called RedirectView. While you look for a startup problem, replace that section so IIS shows the detailed error:

<httpErrors errorMode="Detailed">
</httpErrors>

Otherwise some errors are routed back into the part that has the problem. Also make sure you have:

<system.web>
  <compilation debug="true" />
</system.web>

Restore the original settings afterwards.

Application pool settings to consider:

  • Recycle at a fixed time, the same every day.
  • Disable Overlapped Recycle: True – two copies of MDriven must not run at the same time.
  • Idle Time-out Action: Suspend rather than Terminate.

If server-side jobs or SysAsyncTickets seem to start twice, or the local database is locked by another process, an overlapping recycle is the usual cause:

The application pool keeps restarting: see IIS application restart problem.

Background

An external article on how IIS restarts and recycles processes: https://www.leansentry.com/guide/reset-restart-recycle-iis