Startup class needs a public parameterless constructor

Bevel creates your startup class itself, so it needs a public constructor with no parameters.

  • Error
  • BEVEL041

What it means

The prebuild creates the IBevelDataStartup class before any services exist. It cannot pass constructor arguments.

Example message

text
Data/Posts/BlogPost.cs(6,15): error BEVEL041: IBevelDataStartup 'MySite.Data.BlogStartup' must have a public parameterless constructor. Help: https://khalidabuhakmeh.github.io/bevel/reference/diagnostics/bevel041/

How to fix

Give the class a public constructor with no parameters, or remove the constructor you added.

csharp
public sealed class BlogStartup : IBevelDataStartup
{
    public BlogStartup(IConfiguration config) { }
    public BlogStartup() { }
}