Serenity
Serenity copied to clipboard
Migration from 5.0.26 to 5.0.41 did not mention services.AddExcelExporter() must be added in Startup.cs
In the Add Serenity.Extensions Package Reference of https://serenity.is/docs/migration/v5-0-26-to-v5-0-41 a call to services.AddExcelExporter() was missing, causing an error
InvalidOperationException: Unable to resolve service for type 'Serenity.Reporting.IDataReportExcelRenderer' while attempting to activate 'Serenity.Extensions.Pages.ReportController'.
In the documentation it only state that typeof(Serenity.Extensions.EnvironmentSettings).Assembly should be added
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<ITypeSource>(new DefaultTypeSource(new[]
{
//...
typeof(Serenity.Extensions.EnvironmentSettings).Assembly,
}
}
When it should be
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<ITypeSource>(new DefaultTypeSource(new[]
{
//...
typeof(Serenity.Extensions.EnvironmentSettings).Assembly,
}
//...
services.AddExcelExporter();
}
adding a call to services.AddExcelExporter() service extension
Took me a while to figure out what am I missing.
Related file is in another repository :) PR's are accepted.