My ASP.NET Core web application works fine when I use it with `dotnet run`, but after publishing the website to host under IIS it failes to start. I've followed the docs: https://docs.asp.net/en/latest/publishing/iis.html
I'd appreciate any help.
Here is the error log:
Hosting environment: Production
Content root path: D:\ProjectsRoot\NextRcIssues\NextRcIssues\bin\Release\PublishOutput
Now listening on: http://localhost:10874
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:6300/
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HKTCKACFV25H": An unhandled exception was thrown by the application.
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: offset
at Microsoft.Extensions.Primitives.StringSegment..ctor(String buffer, Int32 offset, Int32 length)
at Microsoft.AspNetCore.Http.Internal.HeaderSegmentCollection.Enumerator.get_Current()
at Microsoft.AspNetCore.Http.Internal.ParsingHelpers.<GetHeaderSplitImplementation>d__2.MoveNext()
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source, Int32& length)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.AspNetCore.Http.Internal.ParsingHelpers.GetHeaderSplit(IHeaderDictionary headers, String key)
at Microsoft.AspNetCore.HttpOverrides.ForwardedHeadersMiddleware.ApplyForwarders(HttpContext context)
at Microsoft.AspNetCore.HttpOverrides.ForwardedHeadersMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Frame`1.<RequestProcessingAsync>d__2.MoveNext()