BeginForm(FormMethod.Get... throws ArgumentOutOfRangeException SS 5.7.1 .NET Core 2.2

Was fooling around with an old razor ViewPage that had a super simple form on it using Post to Get to simply/quickly get around the re-submit browser alert. However using Get produces the below error on render.

        // C:\MyApp\Views\MyFormPage.cshtml
        // ArgumentOutOfRangeException - Index was out of range
       @using (Html.BeginForm(FormMethod.Get, true, new {id = "here"}))
        {
            <input type="hidden" value="test"/>
            <button type="submit">Submit</button>
        }

This however works and has been working since I don’t know when.

        // C:\MyApp\Views\MyFormPage.cshtml
        // Works
       @using (Html.BeginForm(FormMethod.Post, true, new {id = "here"}))
        {
            <input type="hidden" value="test"/>
            <button type="submit">Submit</button>
        }

The only difference is the FormMethod. Post works but Get throws the error on loading/rendering the page (e.g. not when the form is submitted).

This happens in the razor ViewPage or even if I move it into the _Layout.cshtml it throws the same area. I thought maybe because the form was being rendered in a _Layout.cshtml’s .RenderSection("MySection") that might have been the cause but doesn’t seem to be.

The form will probably end up being ajax-ified, so not a show stopper but wanted to make you aware of it in case there is a bigger issue since it seems to be Index out of range issue for a generic List.

Error Code
        ArgumentOutOfRangeException
    Message
        Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
    Stack Trace
        at System.Collections.Generic.List`1.get_Item(Int32 index) at Microsoft.AspNetCore.Mvc.Routing.UrlHelper.get_Router() at Microsoft.AspNetCore.Mvc.Routing.UrlHelper.GetVirtualPathData(String routeName, RouteValueDictionary values) at Microsoft.AspNetCore.Mvc.Routing.UrlHelper.Action(UrlActionContext actionContext) at Microsoft.AspNetCore.Mvc.UrlHelperExtensions.Action(IUrlHelper helper, String action, String controller, Object values, String protocol, String host, String fragment) at Microsoft.AspNetCore.Mvc.UrlHelperExtensions.Action(IUrlHelper helper, String action, String controller, Object values) at Microsoft.AspNetCore.Mvc.ViewFeatures.DefaultHtmlGenerator.GenerateForm(ViewContext viewContext, String actionName, String controllerName, Object routeValues, String method, Object htmlAttributes) at Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.GenerateForm(String actionName, String controllerName, Object routeValues, FormMethod method, Nullable`1 antiforgery, Object htmlAttributes) at Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.BeginForm(String actionName, String controllerName, Object routeValues, FormMethod method, Nullable`1 antiforgery, Object htmlAttributes) at Microsoft.AspNetCore.Mvc.Rendering.HtmlHelperFormExtensions.BeginForm(IHtmlHelper htmlHelper, FormMethod method, Nullable`1 antiforgery, Object htmlAttributes) at AspNetCore.Views_MyFormPage.<>c__DisplayClass0_0.<<ExecuteAsync>b__0>d.MoveNext() in C:\MyApp\Views\MyFormPage.cshtml:line 61 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Mvc.Razor.RazorPage.RenderSectionAsyncCore(String sectionName, Boolean required) at Microsoft.AspNetCore.Mvc.Razor.RazorPage.RenderSection(String name, Boolean required) at AspNetCore.Views_Shared__Layout.<>c__DisplayClass28_0.<<ExecuteAsync>b__1>d.MoveNext() in C:\MyApp\Views\Shared\_Layout.cshtml:line 170 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync() at AspNetCore.Views_Shared__Layout.ExecuteAsync() in C:\MyApp\Views\Shared\_Layout.cshtml:line 151 at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) at ServiceStack.Mvc.RazorFormat.RenderView(IRequest req, Stream stream, ViewDataDictionary viewData, IView view, String layout) in C:\BuildAgent\work\3481147c480f4a2f\src\ServiceStack.Mvc\RazorFormat.cs:line 424
    Errors

ArgumentOutOfRangeException	index	Index was out of range. Must be non-negative and less than the size of the collection

Note: Error happens with or without the action.

@using (Html.BeginForm(FormMethod.Get, true, new { id = "here", action: "/go-here" }))

Html.BeginForm() is not a ServiceStack Html Helper.

Yep! Wasn’t sure if there was some sort of issue with:

ServiceStack.Mvc.RazorFormat.RenderView(IRequest req, Stream stream, ViewDataDictionary viewData, IView view, String layout) in C:\BuildAgent\work\3481147c480f4a2f\src\ServiceStack.Mvc\RazorFormat.cs:line 424