5.8 KiB
ABP Version 7.0 Migration Guide
This document is a guide for upgrading ABP v6.x solutions to ABP v7.0. There are some changes in this version that may affect your applications, please read it carefully and apply the necessary changes to your application.
ABP Framework upgraded to .NET 7.0, so you need to move your solutions to .NET 7.0 if you want to use the ABP 7.0. You can check the Migrate from ASP.NET Core 6.0 to 7.0 documentation.
FormTenantResolveContributor Removed from the AbpTenantResolveOptions
FormTenantResolveContributor has been removed from the AbpTenantResolveOptions. Thus, if you need to get tenant info from HTTP Request From, please add a custom TenantResolveContributor to implement it.
IHybridServiceScopeFactory Removed
IHybridServiceScopeFactory has been removed. Please use the IServiceScopeFactory instead.
Hybrid JSON was removed.
Since System.Text.Json library supports more custom features in NET 7, ABP no longer need the hybrid Json feature.
Previous Behavior
There is a Volo.Abp.Json package which contains the AbpJsonModule module.
Serialization/deserialization features of System.Text.Json and Newtonsoft are implemented in this module.
We use System.Text.Json first, More custom cases can be handled with Newtonsoft by configuring UnsupportedTypes of AbpSystemTextJsonSerializerOptions.
New Behavior
We created Volo.Abp.Json.SystemTextJson and Volo.Abp.Json.Newtonsoft as separate packages, which means you can only use one of them in your project. The default is to use SystemTextJson. If you want Newtonsoft, please also use Volo.Abp.AspNetCore.Mvc.NewtonsoftJson in your web project.
- Volo.Abp.Json.Abstractions
- Volo.Abp.Json.Newtonsoft
- Volo.Abp.Json.SystemTextJson
- Volo.Abp.Json (Depends on
Volo.Abp.Json.SystemTextJsonby default to prevent breaking) - Volo.Abp.AspNetCore.Mvc.NewtonsoftJson
The AbpJsonOptions now has only two properties, which are
InputDateTimeFormats(List<string>): Formats of input JSON date, Empty string means default format. You can provide multiple formats to parse the date.OutputDateTimeFormat(string): Format of output json date, Null or empty string means default format.
Please remove all UnsupportedTypes add custom Modifiers to control serialization/deserialization behavior.
Check the docs to see the more info: https://github.com/abpframework/abp/blob/dev/docs/en/JSON.md#configuration
Check the docs to see how to customize a JSON contract: https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/custom-contracts
"Manage Host Features" Moved to the Settings Page
"Manage Host Features" button has been moved from Tenants page to Settings page.
See https://github.com/abpframework/abp/pull/13359 for more info.
Removed the setter from the Auditing Interfaces
AuditedEntity and other base entity classes will continue to have public setters. If you want to make them private, don't derive from these base classes, but implement the interfaces yourself.
See https://github.com/abpframework/abp/issues/12229#issuecomment-1191384798 for more info.
Added Abp prefix to DbProperties Classes
Please update the database migration and related connection string names.
EntityCreatingEventData, EntityUpdatingEventData, EntityDeletingEventData and EntityChangingEventData has been removed.
They are deprecated don't use them anymore.
LayoutHookInfo.cs, LayoutHookViewModel.cs, LayoutHooks.cs, AbpLayoutHookOptions.cs classes have been moved under the Volo.Abp.Ui.LayoutHooks namespace.
See https://github.com/abpframework/abp/pull/13903 for more info.
Removed abp.auth.policies
abp.auth.polices has been removed, use abp.auth.grantedPolicies instead.
Static C# Proxy Generation
The abp generate-proxy -t csharp .. command will generate all the classes/enums/other types in the client side (including application service interfaces) behalf of you.
If you have reference to the target contracts package, then you can pass a parameter --without-contracts (shortcut: -c).
See https://github.com/abpframework/abp/issues/13613#issue-1333088953 for more info.
Dynamic Permissions
IPermissionDefinitionManagermethods are converted to asynchronous, and renamed (added Async postfix).- Removed
MultiTenancySidesfrom permission groups. - Inherit
MultiTenancySidesenum from byte (default was int). - Needs to add migration for new entities in the Permission Management module.
See https://github.com/abpframework/abp/pull/13644 for more info.
External Localization Infrastructure
- Introduced
LocalizationResourceBasethat is base for localization resources.LocalizationResourceinherits from it for typed (static) localization resources (like before). Also introducedNonTypedLocalizationResourcethat inherits fromLocalizationResourceBasefor dynamic/external localization resources. We are usingLocalizationResourceBasefor most of the places where we were usingLocalizationResourcebefore and that can be a breaking change for some applications. - All layouts in all MVC UI themes should add this line just before the ApplicationConfigurationString line:
<script src="~/Abp/ApplicationLocalizationScript?cultureName=@CultureInfo.CurrentUICulture.Name"></script>
We've already done this for our themes.
See https://github.com/abpframework/abp/pull/13845 for more info.