🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Maxallowedcontentlength
This page was created by Hans.karlsen on 2024-03-28. Last edited by Wikiadmin on 2026-07-29.

You can use maxAllowedContentLength to control the maximum size of HTTP request content accepted by IIS for MDrivenServer and MDriven Turnkey deployments.

What maxAllowedContentLength controls

maxAllowedContentLength is an IIS request-content limit. It determines how much content IIS accepts in one incoming HTTP request.

For example, when a user uploads a file through an application, the uploaded file is part of the request content. If the request is larger than the configured limit, IIS rejects it before the application can process it.

Default in current releases

Current MDriven Server and MDriven Turnkey releases include maxAllowedContentLength set to 1 GB in web.config.

This setting is relevant when your application receives large request bodies, such as file uploads. Keep the configured limit aligned with the largest request size your application is intended to accept.

Configure the limit

Where you configure the limit depends on how the server is hosted.

Hosting situation Where to configure maxAllowedContentLength
MDriven Server or MDriven Turnkey deployment that uses its supplied configuration Review and, if required, change the setting in the deployment's web.config.
.NET 8 Core server Change the setting on the IIS web server itself. Do not rely on an application-level web.config setting to control the IIS limit.

For a deployment using web.config

  1. Locate the deployed application's web.config file.
  2. Find the IIS request-content configuration that contains maxAllowedContentLength.
  3. Confirm that the value is suitable for the largest request your application must receive. Current MDriven Server and MDriven Turnkey releases use 1 GB.
  4. Apply the configuration change using your normal IIS deployment and configuration process.
  5. Test with a request near the expected maximum size.

For a .NET 8 Core server hosted in IIS

  1. Open the configuration for the IIS web server hosting the application.
  2. Change maxAllowedContentLength at the web-server level.
  3. Apply the change according to your IIS administration process.
  4. Test the upload or other large request after the change.

See Documentation:IIS for IIS-related MDriven documentation.

Troubleshooting large requests

If a large upload or request fails, verify the IIS limit before investigating application behavior:

  1. Identify the size of the request that failed.
  2. Compare it with the configured maxAllowedContentLength value.
  3. Confirm whether the application runs as a deployment using web.config or as a .NET 8 Core server hosted in IIS.
  4. Configure the limit in the applicable location: web.config for the supplied deployment configuration, or the IIS web server for a .NET 8 Core server.
  5. Repeat the request with a known test file or request body.

Do not confuse this IIS request-size limit with data-model field length. For attribute precision, scale, and length, see Documentation:Precision.

See also