Skip to content

One line of code causes an IDE exception #78802

@Controllerdestiny

Description

@Controllerdestiny

Version Used:
Vs Version: 17.14.3
Steps to Reproduce:

public static HostApplicationBuilder AddSunSetServices(this HostApplicationBuilder builder)
{
    builder.Services.AddSingleton(_ =>
    {
        throw new ArgumentNullException("BotClient configuration is not set. Please ensure", nameof(builder.Configuration["BotClient:Host"]));
    });
    return builder;
}

A minimal repro, with source-code provided, is ideal. Most compiler/language issues can be distilled into a snippet that can be pasted into sharplab.

Expected Behavior:
Detecting possible errors

Actual Behavior:
vs error: StreamJsonRpc.RemoteInvocationException: Unexpected value 'Unknown' of type 'Microsoft.CodeAnalysis.CSharp.AccessorKind'
在 StreamJsonRpc.JsonRpc.d__156`1.MoveNext()

and will not prompt an error in the editor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions