Can't use fastreport in .net core minimal api

Dear sir,

Please help . I got this error when move to .net core 7 minimal api


Error CS1061 'WebApplication' does not contain a definition for 'UseFastReport' and no accessible extension method 'UseFastReport' accepting a first argument of type 'WebApplication' could be found (are you missing a using directive or an assembly reference?)



Comments

  • Hello!

    An example of how to configure Program.cs and Startup.cs for ASP.NET Core Minimal API (.NET 7 / .NET 8):

    using FastReport.Web;
    
    var builder = WebApplication.CreateBuilder(args);
    builder.Services.AddFastReport();
    
    var app = builder.Build();
    app.UseFastReport();
    app.MapGet("/", () => "OK");
    app.Run();
    


This discussion has been closed.