Maximum request length exceeded when uploading file to IIS 8 - asp.net-mvc

I am getting : Exception Details: System.Web.HttpException: Maximum request length exceeded. I am using Windows 2012 IIS. I checked the settings in IIS and it is set to 30000000. My file I am uploading is 20mb. I tried adding the code below to the web.config file. I have uploaded smaller files with no issues. Any other ideas?
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="3000000000" />
</requestFiltering>
</security>
</system.webServer>

try to set maxRequestLength like this:
<configuration>
<system.web>
<httpRuntime maxRequestLength="500000" />
</system.web>
</configuration>
maxRequestLength indicates the maximum file upload size supported by ASP.NET. The size specified is in kilobytes. The default is 4096 KB (4 MB).

<httpRuntime maxRequestLength="43000000" targetFramework="4.5.2"/>
40 mb
all code system.web
<system.web>
<customErrors mode="Off" >
</customErrors>
<compilation debug="true" targetFramework="4.5.2"/>
<httpRuntime maxRequestLength="43000000" targetFramework="4.5.2"/>
</system.web>

Related

HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure due to some reason

NET core website it Give me this type of error "HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure"
Which version of .NET Core are you using?
This problem can be caused by not having the corresponding AspNetCore module installed in IIS (download hosting bundle from Microsoft website: https://dotnet.microsoft.com/download/dotnet-core). For .NET Core 2.2+ it is AspNetCoreV2.
Also, it can happen if IIS cannot find .NET Core on the machine - you can write the path to it manually in "web.config":
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments=".\AppMainDll.dll" />
</system.webServer>
</location>
</configuration>

IIS turning off Windows authentication every time we redeploy the site

Every time I deploy a basic ASP.NET MVC site to one of our intranet servers, the authentication mode for the site and any sub sites turns off. We have it set to Windows. This does not happen to a second server that we use.
This is what we have in our root web.config file. We can go in to IIS Manager and turn Windows authentication back on, but why does it get turned off each time even though the config file is set to use Windows authentication?
<system.web>
<customErrors mode="Off" />
<compilation targetFramework="4.6.1" />
<httpRuntime targetFramework="4.5" />
<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>
<httpModules />
</system.web>
You could try to add the below section in your web.config file.
<system.webServer>
<security >
<authentication>
<anonymousAuthentication enabled="false" />
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
Or you could directly modify the applicationhost.config file which is located at C:\Windows\System32\inetsrv\config
<location path="TestSite">
<system.webServer>
<security>
<authentication>
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
Note: path="TestSite" use your site name in this section and add this code before the </configuration> tag.

asp.net core app. 500 - Internal server error

I uploaded my website to godaddy windows hosting with plesk.
All files are uploaded but I get an error:
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
From researching the problem online I figured the prob;em must be in my web.config file
I am showing here what I have in my web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false" allowOverride="false">
<system.webServer>
<httpErrors errorMode="Detailed"/>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\myApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
<system.web>
<trust level="Full" />
</system.web>
</location>
<system.web>
<customErrors mode="Off" />
</system.web>
</configuration>
Your host (GoDaddy) will need to setup their servers to support asp.net core
web.config in asp.net MVC core Project
I tried on myproject also, but it didn't work
So after trying everything including calling godaddy and searching all over, I found out that GoDaddy doesn't support asp.net core 2.0 applications
I hosted with 1and1 windows hosting and it runs!

How do I solve HTTP Error 500.19, on External Host Server

I had this error on my local machine, and I was able to give the file permission, but how to solve this error on my host server
I tried to edit web.config, but I still have the same error
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="true" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform>
</system.webServer>
</configuration>
Your host probably didn't install HttpPlatformHandler yet. Talk to them and not here.
[Updated: For RC2 and above, a new module is required instead of HttpPlatformHandler, https://github.com/aspnet/Announcements/issues/164]

windows server 2008 IIS 7.5 maximum file accept limit

I have deployed my application on IIS 7.5 on windows server 2008 operating system and i want to know what is the maximum file upload limit and how to increase that limit? Im working on asp.net mvc2
This setting configures the upload file size limit:
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="10485760"/>
</requestFiltering>
</security>
</system.webServer>
Default size is ~30Mb.
Set your web.config with the following where xxx is the max upload size in kilobytes:
<configuration>
<system.web>
<httpRuntime maxRequestLength="xxx" />
</system.web>
</configuration>
The default is 4096 (= 4 MB). MSDN documentation
Read this blog post and you will find out what is the maximum length and how to increase its limit

Resources