Skip to content

error CS8983: A 'struct' with field initializers must include an explicitly declared constructor.  #23971

@danielkon96

Description

@danielkon96

Describe the bug

I have the following code that throws the error in the title when I try to build my project. It was not happening on build engine 17.0.0+c9eb9dd64 but now happens on 17.1.0+ae57d105c. The error code is no new there is no documentation around it. I first found it when building my project in GitHub Actions.

To Reproduce

public struct AppManifestResult
{
    public bool Succeeded { get; set; } = false;
    public Exception? Exception { get; set; } = null;
    public AppManifest? AppManifest { get; set; } = null;
}

Exceptions (if any)

Further technical details

C:\Users\dakondra\source\repos\EasyAuthForK8s\src\EasyAuthForK8s.Web\Models\AppManifest.cs(118,19,118,36): error CS8983: A 'struct' with field initializers must include an explicitly declared constructor.
1>Done building project "EasyAuthForK8s.Web.csproj" -- FAILED.

  • VS 2022 version 17.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions