Skip to content

Latest commit

 

History

History
1066 lines (759 loc) · 30.9 KB

v5-0-26-to-v5-0-41.md

File metadata and controls

1066 lines (759 loc) · 30.9 KB

Upgrading from v5.0.26 to v5.0.41

New Set of Feature Packages

We started separating shared modules into their own projects and nuget packages in 5.0.20, initially with Serenity.Demo.ThemeSamples package.

In this version, most of other modules like Basic Samples, Advanced Samples, Email Client, Email Queue, Reporting etc. are also separated into their own projects and nuget packages. This allows us to share code between Serene and StartSharp and will also make it easier for you to update / remove them when needed. They are also good samples of separating your own modules if desired.

This also means that, upgrading an existing project to this version will take a bit more changes than usual. But it will make later migrations simpler as they will be simply about updating a package reference instead of manual modifications to update shared code.

You don't have to use these feature packages. If you want to keep the shared code in your project you can do that. In that case you'll need to manually update such shared code in the future by looking at commits and diffs.

Who should apply these changes?

If you created your project from a StartSharp / Serene 5.0.41.0+ template you don't need to apply changes in this document.

If the project was created from 5.0.40 or an earlier version, then please first apply migrations earlier migrations listed on left.

StartSharp customers should use stargen to automate most of the changes listed here.

If you are not sure which version of a template your project was created from, you may check your sergen.json file. Since version 5.0.19, StartSharp/Serene projects contain information about the initial version of the template under UpgradeInfo section:

"UpgradeInfo": {
    "InitialType": "Premium",
    "InitialVersion": "5.0.20.0"
  }
>

If InitialVersion is not shown there, it means your initial template version is less than 5.0.19.

Serenity Package Versions

You should first update your Serenity package versions to 5.0.41 minimum.

Your package versions should look like this at minimum:

<PackageReference Include="Serenity.Net.Web" Version="5.0.41" />
<PackageReference Include="Serenity.Assets" Version="5.0.40" />
<PackageReference Include="Serenity.Scripts" Version="5.0.41" />

Changing [JsonFilter] to [JsonRequest]

JsonFilter is a Serenity attribute that handles deserializing a JSON post request to request parameter of a service method.

It is now renamed to JsonRequest which matches the usage of it better and has new options like preventing it to be used for GET requests etc.

JsonFilter is still available but is obsolete.

  • Open Replace in Fields dialog in Visual Studio Ctrl+Shift+H

  • Make sure Look in is Current project, Match case is Checked, Match whole word is NOT checked and Use regular expressions is checked.

  • Type (\[|,|\s)JsonFilter(\]|,|\s) in Find input

  • Type $1JsonRequest$2 in Replace input

  • Click Replace All

Replacing XPagedList source version with a package reference

We used to have a modified version of XPagedList source code under Modules/Common/Helpers/XPagedList in StartSharp as in the past this package did not have a .NET Core version.

Remove this folder and add it as a package reference if you use it for some page other than Advanced Samples.

It is normally only used for bootstrap form sample in Advanced Samples module and we'll be converting it to use a package reference as well, so if you don't use this XPagedList anywhere, you don't need to add a package reference.

Only add it back if you get a compilation error about X namespace after removing the XPagedList folder and AdvancedSamples module:

<PackageReference Include="X.PagedList.Mvc.Core" Version="8.0.7" />

Updating dotnet sergen tool

If you haven't already, update dotnet sergen tool to latest.

Open a command prompt in your project directory and type following:

dotnet tool update sergen 

Changing DotnetSergenExe Path

This should be only necessary if you are using Serenity as a submodule (with sources), otherwise you may skip this step.

Find this line in YourProject.csproj:

<DotNetSergenExe>$(SerenitySrc)Serenity.Net.CodeGenerator\
bin\$(Configuration)\$(TargetFramework)\sergen.exe</DotNetSergenExe>

and remove the $(Configuration)\$(TargetFramework) part:

<DotNetSergenExe>$(SerenitySrc)Serenity.Net.CodeGenerator\
bin\sergen.exe</DotNetSergenExe>

Fixing dotnet sergen restore command

Find this line in YourProject.csproj:

<Exec Command="dotnet sergen restore" ContinueOnError="true" 
    Condition="!Exists('wwwroot\Scripts\serenity\Serenity.CoreLib.js')" />

Change it to:

<Exec Command="$(DotNetSergen) restore" ContinueOnError="true" />

Modifying tsconfig.json

Modify typeRoots setting in tsconfig.json:

"typeRoots": [
    "./node_modules/@types/"
]

and add ./typings:

"typeRoots": [
    "./node_modules/@types/",
    "./typings"
]

Remove following lines from include setting (if you have them):

    "./wwwroot/Scripts/serenity/Serenity.CoreLib.d.ts",
    "./typings/jspdf/jspdf.autotable.d.ts",
    "./wwwroot/Scripts/serenity/Serenity.Pro.UI.d.ts",
    "./wwwroot/Scripts/serenity/Serenity.Pro.App.d.ts",
    "./wwwroot/Scripts/serenity/Serenity.Pro.EmailClient.d.ts",

From now on, we'll be distributing TypeScript typings through nuget packages and sergen will automatically restore them into your "typings" folder during build.

Modifying sergen.json

Add following Restore configuration just after your RootNamespace setting:

{
  "RootNamespace": "YourRootNamespace",
  "Restore": {
    "Exclude": [
      "/wwwroot/Scripts/serenity/Serenity.CoreLib*.*"
    ]
  },
  //...
}

Remove following folders if you have them:

  • typings\serenity
  • typings\jspdf

Modifying appsettings.bundles.json

Replace following line in appsettings.bundles.json

"~/Scripts/serenity/Serenity.CoreLib.js",

with

"~/Serenity.Scripts/Serenity.CoreLib.js",

Add Serenity.Extensions Package Reference

Serenity.Extensions is a new package for common code that is shared between Serene / StartSharp applications. It contains code that was mostly under Common directory of these projects like ExcelExportHelper, GridEditorBase, Reporting, UserPreference.

This should be added for both Serene / StartSharp projects, and is shared between other feature packages.

<PackageReference Include="Serenity.Extensions" Version="5.0.41" />

After adding this package you should remove following files and folders:

If you made any modifications to any of these files, please take a backup.

  • Modules/Common/EmailSender/*
  • Modules/Common/Helpers/BasicProgressDialog.ts
  • Modules/Common/Helpers/BulkServiceAction.ts
  • Modules/Common/Helpers/DialogUtils.ts
  • Modules/Common/Helpers/EnumSelectFormatter.ts
  • Modules/Common/Helpers/ExcelExportHelper.ts
  • Modules/Common/Helpers/ExcelImportRequest.cs
  • Modules/Common/Helpers/GetNextNumberHelper.cs
  • Modules/Common/Helpers/GetNextNumberRequest.cs
  • Modules/Common/Helpers/GridEditorBase.ts
  • Modules/Common/Helpers/GridEditorDialog.ts
  • Modules/Common/Helpers/PromptDialog.ts
  • Modules/Common/Helpers/ServiceEditorBase.ts
  • Modules/Common/Helpers/StaticTextBlock.ts
  • Modules/Common/Reporting/*
  • Modules/Common/UserPreference/*

Register Serenity.Extensions in ConfigureServices method of Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
    services.AddSingleton<ITypeSource>(new DefaultTypeSource(new[] 
    {
        //...
        typeof(Serenity.Extensions.EnvironmentSettings).Assembly,
    }
}

Insert following line in appsettings.bundles.json after Serenity.CoreLib.js

"~/Serenity.Scripts/Serenity.CoreLib.js",
"~/Serenity.Extensions/index.js",

Update / Remove MailKit Reference

YourProject.csproj should have a MailKit package reference like below:

<PackageReference Include="MailKit" Version="2.4.1" />

Either update it to a more recent version:

<PackageReference Include="MailKit" Version="2.10.1" />

Or remove that line completely, as you'll still have that reference through Serenity.Extensions package.

Adding Serenity.Extensions to Usings

As we removed some code that is moved to Serenity.Extensions package, their namespace is also changed. When you build your project you'll get some errors about following types:

  • IEmailSender
  • GetNextNumberRequest
  • GetNextNumberResponse
  • GetNextNumberHelper
  • ExcelImportRequest
  • ExcelImportResponse

Add Serenity.Extensions namespace to usings for all those source files.

using Serenity.Extensions;

In Startup.cs add Serenity.Extensions to using list and modify following lines:

services.AddSingleton<Common.IEmailSender, Common.EmailSender>();
services.Configure<Common.SmtpSettings>(
    Configuration.GetSection(Common.SmtpSettings.SectionKey));

with

services.AddSingleton<IEmailSender, EmailSender>();
services.Configure<SmtpSettings>(
    Configuration.GetSection(SmtpSettings.SectionKey));

If you get an error about following type:

  • UserPreferenceRow

Add Serenity.Extensions.Entities to usings.

Fixing ListExcel Methods

Exporting to excel is abstracted using dependency injection so code like below needs to be modified:

public FileContentResult ListExcel(IDbConnection connection, 
    ListRequest request)
{
    var data = List(connection, request).Entities;
    var report = new DynamicDataReport(data, request.IncludeColumns,
        typeof(Columns.ProductColumns), HttpContext.RequestServices);
    var bytes = ReportRepository.Render(report);
    return ExcelContentResult.Create(bytes, ...)
}

to this:

public FileContentResult ListExcel(IDbConnection connection, 
    ListRequest request, 
    [FromServices] IExcelExporter exporter)
{
    var data = List(connection, request).Entities;
    var bytes = exporter.Export(data, 
        typeof(Columns.ProductColumns), request.ExportColumns);
    return ExcelContentResult.Create(bytes, ...)
}

Note that column type becomes the second parameter and instead of using IncludeColumns, we now use ExportColumns.

IncludeColumns is a HashSet which did not guarantee column order, and it has a different purpose.

Fixing Report Pages

If you have a Reports tree page like following:

[Route("MyModule/Reports")]
public ActionResult Index()
{
    return View(MVC.Views.Common.Reporting.ReportPage,
        new ReportRepository(Context, ReportRegistry)
            .GetReportTree("MyModule"));
}

It needs to be modified like below:

using Serenity.Extensions.Repositories;

[Route("MyModule/Reports")]
public ActionResult Index()
{
    return View("~/Serenity.Extensions/Reporting/ReportPage.cshtml",
        new ReportRepository(Context, ReportRegistry)
            .GetReportTree("MyModule"));
}

Build Project to Restore Typings

If you fixed every compile error so far, when you build dotnet sergen restore should automatically run and restore following files:

  • typings/serenity.corelib/index.d.ts
  • typings/serenity.extensions/index.d.ts

You should not have other folders under typings yet. If you still have typings/serenity/Serenity.CoreLib.d.ts or typings/jspdf/jspdf.autotable.d.ts files there, delete them, update sergen tool / sergen.json and try building again. If those files are still coming back, then something is wrong with your configuration.

Fixing GridEditorBase / GridEditorDialog References

As GridEditorBase and GridEditorDialog classes are moved into Serenity.Extensions, you'll need to find following references and fix them:

/// <reference path="../../../Common/Helpers/GridEditorBase.ts" />

namespace MyProject.MyModule {

    @Serenity.Decorators.registerClass()
    export class MyEditor extends 
        Common.GridEditorBase<MyModule.MyRow> {

Simply search for GridEditorBase in your project and fix those files like below:

namespace MyProject.MyModule {

    @Serenity.Decorators.registerClass()
    export class MyEditor extends 
        Serenity.Extensions.GridEditorBase<MyModule.MyRow> {

Note that you also should remove the /// <reference comment line on top.

Similarly, search for GridEditorDialog in your project:

/// <reference path="../../Common/Helpers/GridEditorDialog.ts" />

namespace MyProject.MyModule {

    @Serenity.Decorators.registerClass()
    export class OrderDetailDialog extends 
        Common.GridEditorDialog<MyRow> {

and fix them like following:

namespace MyProject.MyModule {

    @Serenity.Decorators.registerClass()
    export class OrderDetailDialog extends 
        Serenity.Extensions.GridEditorDialog<MyRow> {

Fixing ServiceEditorBase References

Search for ServiceEditorBase in your project for such files:

/// <reference path="../../../Common/Helpers/ServiceEditorBase.ts" />

namespace MyProject.MyNamespace {

    @Serenity.Decorators.registerEditor()
    export class MyEditor extends
        ServiceEditorBase<ServiceEditorOptions, MyRow> {
    }

    constructor(hidden: JQuery, options: ServiceEditorOptions) {
        super(hidden, options);
    }    

and fix them like this:

namespace MyProject.MyNamespace {

    @Serenity.Decorators.registerEditor()
    export class MyEditor extends
        Serenity.Extensions.ServiceEditorBase<
            Serenity.Extensions.ServiceEditorOptions, MyRow> {
    }

    constructor(hidden: JQuery,
        options: Serenity.Extensions.ServiceEditorOptions) {
        super(hidden, options);
    }    

Fixing BulkServiceAction References

Search for BulkServiceAction in your project for such files:

/// <reference path="../../../Common/Helpers/BulkServiceAction.ts" />

namespace MyProject.MyNamespace {

    export class MyAction extends Common.BulkServiceAction {

and fix them like this:

namespace MyProject.MyNamespace {

    export class MyAction extends Serenity.Extensions.BulkServiceAction {

Replace Remaining Serenity.Extensions References

Do following replace in *.ts files (with regex):

([\s\(,])([A-Za-z_0-9]*\.)?(Common\.)?(DialogUtils|PromptDialog|ExcelExportHelper|PdfExportHelper|ReportHelper|UserPreferenceStorage)([\.\(])

with

$1Serenity.Extensions.$4$5

Your project should now be building successfully.

Add HumanizeSqlExceptionBehavior

To make SQL foreign key error messages a bit friendlier for all repositories, add this content to Modules/Common/Helpers/HumanizeSqlExceptionBehavior.cs:

using Microsoft.Data.SqlClient;
using Serenity.Data;
using Serenity.Services;
using System;

namespace MyProject
{
    public class HumanizeSqlExceptionBehavior : BaseSaveDeleteBehavior, IImplicitBehavior
    {
        public bool ActivateFor(IRow row)
        {
            return true;
        }

        public override void OnException(ISaveRequestHandler handler, Exception exception)
        {
            if (exception is SqlException)
                SqlExceptionHelper.HandleSavePrimaryKeyException(exception, handler.Context?.Localizer, 
                    handler.Row?.IdField?.GetTitle(handler.Context?.Localizer));
        }

        public override void OnException(IDeleteRequestHandler handler, Exception exception)
        {
            if (exception is SqlException)
                SqlExceptionHelper.HandleDeleteForeignKeyException(exception, handler.Context?.Localizer);
        }
    }
}

Add Serenity.Pro.Extensions Package Reference

Serenity.Pro.Extensions contains common code for StartSharp applications.

Serene users should not try to install this package.

It contains some code from the old Serenity.Pro.Scripts package (which is now obsolete and we'll be removing it in the next step)

Make sure you extract latest pro-packages.zip file you can download from StartSharp repository releases tab to your pro-packages folder first.

<PackageReference Include="Serenity.Pro.Extensions" Version="5.0.41" />

After adding this package you should remove following files and folders:

If you made any modifications to any of these files, please take a backup.

  • Imports/ClientTypes/ComponentModel.SingleLineTextFormatterAttribute.cs
  • Initialization/SqlErrorStore.cs
  • Initialization/Startup.ExceptionLog.cs
  • Modules/Common/BackgroundTasks/*

Open Startup.cs and add Serenity.Pro.Extensions to using list.

If you have this line in Startup.cs

InitializeExceptionLog(services, Configuration);

replace it with:

ExceptionLog.Initialize(services, HostEnvironment.ApplicationName,
    Configuration["Data:Default:ConnectionString"], Configuration["Data:Default:ProviderName"]);

If you have any background jobs like this:

public class MyBackgroundJob : PeriodicBackgroundJob

also add Serenity.Pro.Extensions to their using list.

Remove this package reference:

<PackageReference Include="Serenity.Pro.Scripts" Version="5.0.12" />

Edit Modules\Texts.cs and remove following texts (they are now shipped with Serenity.Pro.Extensions):

public static class CardViewMixin
{
    //...
}

public static class FavoriteViewsMixin
{
    //...
}

public static class HeaderFiltersMixin
{
    //...

public static class DraggableGroupingMixin
{
    //...
}

public static class WizardDialog
{
}

You may remove following package reference:

<PackageReference Include="StackExchange.Exceptional.AspNetCore" Version="2.1.0" />

Remove the following lines from project file:

    <CreateItem Include="..\..\Serenity.Pro\Serenity.Pro.Scripts\dist\*.*" 
        Condition="Exists('..\..\Serenity.Pro\Serenity.Pro.Scripts\dist\Serenity.Pro.UI.js')">
      <Output TaskParameter="Include" ItemName="SerenityProScripts" />
    </CreateItem>
    <CreateItem Include="..\..\Serenity.Pro\Serenity.Pro.Scripts\texts\*.json" 
        Condition="Exists('..\..\Serenity.Pro\Serenity.Pro.Scripts\dist\Serenity.Pro.UI.js')">
      <Output TaskParameter="Include" ItemName="SerenityProTexts" />
    </CreateItem>

  <Target Name="CopySerenityProFiles" BeforeTargets="BeforeBuild" 
    Condition="Exists('..\..\Serenity.Pro\Serenity.Pro.Scripts\dist\Serenity.Pro.UI.js')">
    <Copy SourceFiles="@(SerenityProScripts)"
         DestinationFolder="wwwroot\Scripts\serenity" SkipUnchangedFiles="true" />
    <Copy SourceFiles="@(SerenityProTexts)"
         DestinationFolder="wwwroot\Scripts\serenity\texts" SkipUnchangedFiles="true" />
  </Target>

Register Serenity.Pro.Extensions in ConfigureServices method of Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
    services.AddSingleton<ITypeSource>(new DefaultTypeSource(new[] 
    {
        //...
        typeof(Serenity.Pro.Extensions.BackgroundJobManager).Assembly,
    }
}

Remove following line in appsettings.bundles.json:

"~/Scripts/serenity/Serenity.Pro.App.js"`

and insert following after Serenity.Extensions/index.js

"~/Serenity.Extensions/index.js",
"~/Serenity.Pro.Extensions/index.js",

Add Serenity.Pro.UI Package Reference

StartSharp users who had used Email client or created React based UI component should install following package:

<PackageReference Include="Serenity.Pro.UI" Version="5.0.41" />

Remove following line in appsettings.bundles.json:

"~/Scripts/serenity/Serenity.Pro.UI.js"`

Insert following line in appsettings.bundles.json after Serenity.Pro.Extensions/index.js

"~/Serenity.Pro.Extensions/index.js",
"~/Serenity.Pro.UI/index.js",

Add Serenity Demo Package References (If Used)

If you still have Northwind, Basic Samples or Advanced Samples (StartSharp only) in your project add these package references:

These are demo modules, you don't need them in a production application

<PackageReference Include="Serenity.Demo.Northwind" Version="5.0.41" />
<PackageReference Include="Serenity.Demo.BasicSamples" Version="5.0.41" />
<!--StartSharp Only-->
<PackageReference Include="Serenity.Demo.AdvancedSamples" Version="5.0.41" /> 

After adding this package you should remove following files and folders:

If you made any modifications to any of these files, please take a backup.

  • Modules/Northwind/*
  • Modules/BasicSamples/*
  • Modules/AdvancedSamples/*
  • Imports/ClientTypes/BasicSamples*.*
  • Imports/ClientTypes/AdvancedSamples*.*
  • Imports/ClientTypes/Northwind*.*
  • Imports/ServerTypings/BasicSamples*.*
  • Imports/ServerTypings/AdvancedSamples*.*
  • Imports/ServerTypings/Northwind*.*
  • Migrations/NorthwindDB/*
  • wwwroot/Content/site/site.basicsamples.less
  • wwwroot/Content/site/site.advancedsamples.less
  • wwwroot/Content/site/site.northwind.less

Edit DashboardPage.cs and replace this usings:

using MyProject.Northwind;
using MyProject.Northwind.Entities;

with

using Serenity.Demo.Northwind;
using Serenity.Demo.Northwind.Entities;

Edit DataAuditLogPage.cs and add Serenity.Demo. before every Northwind. (do it with search replace):

using (var cnn = sqlConnections.NewFor<Northwind.Entities.OrderRow>())

with

using (var cnn = sqlConnections.NewFor<Serenity.Demo.Northwind.Entities.OrderRow>())

Edit wwwroot/Content/site/site.less and remove following lines:

@import "site.basicsamples.less";
@import "site.advancedsamples.less";
@import "site.northwind.less";

Register these assemblies in ConfigureServices method of Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
    services.AddSingleton<ITypeSource>(new DefaultTypeSource(new[] 
    {
        //...
        typeof(Serenity.Demo.Northwind.CustomerController).Assembly,
        typeof(Serenity.Demo.BasicSamples.BasicSamplesController).Assembly,
        typeof(Serenity.Demo.AdvancedSamples.AdvancedSamplesController).Assembly,
    }
}

Find following block in DataMigrations.cs:

var serviceProvider = new ServiceCollection()
    .AddLogging(lb => lb.AddFluentMigratorConsole())
    .AddFluentMigratorCore()
    .AddSingleton<IConventionSet>(conventionSet)
    .Configure<TypeFilterOptions>(options =>
    {
        options.Namespace = "MyProject.Migrations." + databaseKey + "DB";
    })
    .Configure<ProcessorOptions>(options =>
    {
        options.Timeout = TimeSpan.FromSeconds(90);
    })
    .ConfigureRunner(builder =>
    {
        //...
        builder.WithMigrationsIn(typeof(DataMigrations).Assembly);  

and modify like below

var migrationNamespace = "MyProject.Migrations." + databaseKey + "DB";
var migrationAssemblies = new[] { typeof(DataMigrations).Assembly };

if (databaseKey.Equals("Northwind", StringComparison.OrdinalIgnoreCase))
{
    migrationNamespace = typeof(Serenity.Demo.Northwind.Migrations.MigrationAttribute).Namespace;
    migrationAssemblies = new[] { typeof(Serenity.Demo.Northwind.Migrations.MigrationAttribute).Assembly };
}

var serviceProvider = new ServiceCollection()
    .AddLogging(lb => lb.AddFluentMigratorConsole())
    .AddFluentMigratorCore()
    .AddSingleton<IConventionSet>(conventionSet)
    .Configure<TypeFilterOptions>(options =>
    {
        options.Namespace = migrationNamespace;
    })
    .Configure<ProcessorOptions>(options =>
    {
        options.Timeout = TimeSpan.FromSeconds(90);
    })
    .ConfigureRunner(builder =>
    {
        //...
        builder.WithMigrationsIn(migrationAssemblies);
    })

Add Serenity.Pro.DataExplorer Package Reference (If Used)

StartSharp DataExplorer which used to be in Advanced Samples module is now in its own Serenity.Pro.DataExplorer package. It is also referenced by Serenity.Demo.AdvancedSamples if you install it.

If you are using Data Explorer, please add this reference to project:

<PackageReference Include="Serenity.Pro.DataExplorer" Version="5.0.41" />

And remove following folders if you haven't already:

  • Modules/AdvancedSamples/Misc/DataExplorer/*
  • Imports/ClientTypes/AdvancedSamples.DataExplorer*.*
  • Imports/ServerTypings/AdvancedSamples.DataExplorer*.*

Edit Startup.cs and replace below line:

services.Configure<AdvancedSamples.DataExplorerConfig>(
    Configuration.GetSection(AdvancedSamples.DataExplorerConfig.SectionKey));

with

services.Configure<Serenity.Pro.DataExplorer.DataExplorerConfig>(
    Configuration.GetSection(Serenity.Pro.DataExplorer.DataExplorerConfig.SectionKey));

Register Serenity.Pro.DataExplorer in ConfigureServices method of Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
    services.AddSingleton<ITypeSource>(new DefaultTypeSource(new[] 
    {
        //...
        typeof(Serenity.Pro.DataExplorer.DataExplorerController).Assembly,
    }
}

Add Serenity.Pro.EmailClient Package Reference (If Used)

StartSharp Email IMAP Client is now in its own Serenity.Pro.EmailClient package. It is also referenced by Serenity.Demo.AdvancedSamples if you install it.

If you are using Email IMAP Client, please add this reference to project:

<PackageReference Include="Serenity.Pro.EmailClient" Version="5.0.41" />

Edit Modules\Texts.cs and remove EmailClient texts:

public static class EmailClient
{
    public static LocalText ToggleReadButton = "Toggle Read";
    ...
}

And remove following folders:

  • Modules/Common/EmailClient/*

Register Serenity.Pro.EmailClient in ConfigureServices method of Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
    services.AddSingleton<ITypeSource>(new DefaultTypeSource(new[] 
    {
        //...
        typeof(Serenity.Pro.EmailClient.MailboxController).Assembly,
    }
}

Add Serenity.Pro.DataAuditLog Package Reference (If Used)

StartSharp Audit Log feature is now in its own Serenity.Pro.DataAuditLog package. It is also referenced by Serenity.Demo.AdvancedSamples if you install it.

If you are using Data Audit Log functionality, please add this reference to project:

<PackageReference Include="Serenity.Pro.DataAuditLog" Version="5.0.41" />

And remove following folders:

  • Modules/Administration/DataAuditLog/*

Register Serenity.Pro.DataAuditLog in ConfigureServices method of Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
    services.AddSingleton<ITypeSource>(new DefaultTypeSource(new[] 
    {
        //...
        typeof(Serenity.Pro.DataAuditLog.DataAuditLogController).Assembly,
    }
}

Add Serenity.Pro.EmailQueue Package Reference (If Used)

StartSharp Email Queue feature is now in its own Serenity.Pro.EmailQueue package.

If you are using Email Queue functionality, please add this reference to project:

<PackageReference Include="Serenity.Pro.EmailQueue" Version="5.0.41" />

And remove following folders:

  • Modules/Common/Mail/*

Edit AdministrationNavigation.cs and fix following navigation link:

[assembly: NavigationLink(9000, "Administration/Mail Queue", 
    typeof(MyProject.Common.Pages.MailController), icon: "fa-envelope-o premium-sample")]

as:

[assembly: NavigationLink(9000, "Administration/Mail Queue",
    typeof(Serenity.Pro.EmailQueue.EmailQueueController), icon: "fa-envelope-o premium-sample")]

Edit Startup.cs file and remove this using (if you are getting an error):

using MyProject.Common.Services;

Add Serenity.Pro.EmailQueue to using list and replace following line:

services.Configure<MailingServiceSettings>(
    Configuration.GetSection(MailingServiceSettings.SectionKey));

with:

services.Configure<Serenity.Pro.EmailQueue.EmailQueueJobSettings>(
    Configuration.GetSection(Serenity.Pro.EmailQueue.EmailQueueJobSettings.SectionKey));

and following line:

backgroundJobManager.Register(
    ActivatorUtilities.CreateInstance<MailingBackgroundJob>(app.ApplicationServices));

with

backgroundJobManager.Register(ActivatorUtilities
    .CreateInstance<Serenity.Pro.EmailQueue.EmailQueueJob>(app.ApplicationServices));

Edit UserRepository.cs and remove following using:

using MyProject.Common.Entities;

Register Serenity.Pro.EmailQueue in ConfigureServices method of Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
    services.AddSingleton<ITypeSource>(new DefaultTypeSource(new[] 
    {
        //...
        typeof(Serenity.Pro.EmailQueue.EmailQueueController).Assembly,

    }
}

Add Serenity.Pro.Organization Package Reference (If Used)

StartSharp Organization tree feature is now in its own Serenity.Pro.Organization package.

If you are using Organization or Meeting functionality, please add this reference to project:

<PackageReference Include="Serenity.Pro.Organization" Version="5.0.41" />

And remove following files and folders:

  • Modules/Organization/*
  • Imports/ClientTypes/Organization.*
  • Imports/ServerTypings/Organization.*
  • wwwroot/Content/site/site.organization.less

Edit wwwroot/Content/site/site.less and remove following lines:

@import "site.organization.less";

Register Serenity.Pro.Organization in ConfigureServices method of Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
    services.AddSingleton<ITypeSource>(new DefaultTypeSource(new[] 
    {
        //...
        typeof(Serenity.Pro.Organization.BusinessUnitController).Assembly,
    }
}

Add Serenity.Pro.Meeting Package Reference (If Used)

StartSharp Meeting feature is now in its own Serenity.Pro.Meeting package.

If you are using Meeting functionality, please add this reference to project:

<PackageReference Include="Serenity.Pro.Meeting" Version="5.0.41" />

And remove following files and folders:

  • Modules/Meeting/*
  • Imports/ClientTypes/Meeting.*
  • Imports/ServerTypings/Meeting.*
  • wwwroot/Content/site/site.meeting.less

Edit wwwroot/Content/site/site.less and remove following lines:

@import "site.meeting.less";

Register Serenity.Pro.Meeting in ConfigureServices method of Startup.cs:

public void ConfigureServices(IServiceCollection services)
{
    services.AddSingleton<ITypeSource>(new DefaultTypeSource(new[] 
    {
        //...
        typeof(Serenity.Pro.Meeting.MeetingController).Assembly,
    }
}