Reputation: 1
I have asp.net core project, during publishing on IIS on my local computer it works. I moved my project folder to another computer IIS, and getting error "The request filtering module is configured to deny a request where the query string is too long". I am using cookies authentication
services.AddAuthentication(options =>
{
options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChal`enter code here`lengeScheme =
CookieAuthenticationDefaults.AuthenticationScheme;
})
What can be a problem, if it work on my comp, why it doesn't work on another comp.
Upvotes: 0
Views: 11769
Reputation: 28352
According to the error message, this issue is thrown by the IIS request filter module, I suggest you could try to add below web.config setting to extend the query string limit to avoid this error.
Open your asp.net core application web.config file and add below setting :
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxQueryString="8156" />
</requestFiltering>
</security>
</system.webServer>
Whole web.config example:
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\WinAuthCore.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
</system.webServer>
</location>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxQueryString="8156" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
Upvotes: 3