Maximum request length exceeded error from ASMX call inside an asp net core application

Wojciech Rajchel | reconline AG 0 Reputation points


Within an .Net 6.0 framework application I created a service reference to an old asmx webservice. It is a migration of an old webforms program. The .Net program uploads various images into the webserver. The larger images causes an Exception "Maximum request length exceeded". On the server the application is hosted inside IIS. I have configured web.config in the same way as in the old working webforms code. Still the same exception is thrown. How can I solve the issue?

trace: System.ServiceModel.FaultException: System.Web.Services.Protocols.SoapException: There was an exception running the extensions specified in the config file. ---> System.Web.HttpException: Maximum request length exceeded.

   at System.Web.HttpRequest.GetEntireRawContent()

   at System.Web.HttpRequest.get_InputStream()

   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()

   --- End of inner exception stack trace ---

   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()

   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)


<?xml version="1.0" encoding="utf-8"?>




        <add name="aspNetCore" path="" verb="" modules="AspNetCoreModuleV2" resourceType="Unspecified" />


      <aspNetCore processPath=".\Myapp.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />



        <requestLimits maxAllowedContentLength="1073741824" />





    <httpRuntime maxRequestLength="1048576" executionTimeout="1200" />



Internet Information Services
A set of technologies in the .NET Framework for building web applications and XML web services.
4,154 questions
{count} votes