Skip to content

FormatException: Input string was not in a correct format #5640

@danroth27

Description

@danroth27

When working on replicating the TabSet component from the last Blazor community standup I got this exception with VS 2017 15.9 and the Blazor 0.7.0-preview1 build:

System.FormatException: Input string was not in a correct format.
 at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
 at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
 at System.String.Format(IFormatProvider provider, String format, Object[] args)
 at Microsoft.AspNetCore.Razor.Language.DefaultRazorDiagnostic.GetMessage(IFormatProvider formatProvider)
 at Microsoft.VisualStudio.Web.Editors.Razor.RazorCodeGenerator.NotifyOnCodeGenerationComplete()
 at Microsoft.VisualStudio.Web.Editors.Razor.RazorCodeGenerator.<>c__DisplayClass67_0.<OnDocumentStructureChanged>b__0()
 at Microsoft.Web.Editor.Utility.GuardedOperations.InvokeExtensionPoint(Object errorSource, Action action)
 --- End of stack trace from previous location where exception was thrown ---
 at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

Here's the component file I was working on:

<ul class="nav nav-tabs">
    @foreach (var tab in tabs)
    {
        <li class="nav-item">
            <a onclick="@(() => SelectTab(tab))" class="nav-link @(tab==)
        </li>
    }

</ul>


@functions {

}

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions