VCP Version 7.0 Migration Guide
This document is a guide for upgrading VCP v6.x solutions to VCP 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.
VCP upgraded to .NET 7.0, so you need to move your solutions to .NET 7.0 if you want to use the VCP 7.0. You can check the Migrate from ASP.NET Core 6.0 to 7.0 documentation.
Open-Source (Framework)
If you are using one of the open-source startup templates, then you can check the following sections to apply the related breaking changes:
FormTenantResolveContributor
Removed from the VcpTenantResolveOptions
FormTenantResolveContributor
has been removed from the VcpTenantResolveOptions
. 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, VCP no longer need the hybrid Json feature.
Previous Behavior
There is a Verto.Vcp.Json
package which contains the VcpJsonModule
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 VcpSystemTextJsonSerializerOptions
.
New Behavior
We created Verto.Vcp.Json.SystemTextJson
and Verto.Vcp.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 Verto.Vcp.AspNetCore.Mvc.NewtonsoftJson
in your web project.
- Verto.Vcp.Json.Abstractions
- Verto.Vcp.Json.Newtonsoft
- Verto.Vcp.Json.SystemTextJson
- Verto.Vcp.Json (Depends on
Verto.Vcp.Json.SystemTextJson
by default to prevent breaking) - Verto.Vcp.AspNetCore.Mvc.NewtonsoftJson
The VcpJsonOptions
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/vcpframework/vcp/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/vcpframework/vcp/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/vcpframework/vcp/issues/12229#issuecomment-1191384798 for more info.
Added Vcp 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, VcpLayoutHookOptions.cs classes have been moved under the Verto.Vcp.Ui.LayoutHooks namespace.
See https://github.com/vcpframework/vcp/pull/13903 for more info.
Removed vcp.auth.policies
vcp.auth.polices
has been removed, use vcp.auth.grantedPolicies
instead.
Static C# Proxy Generation
The vcp 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/vcpframework/vcp/issues/13613#issue-1333088953 for more info.
Dynamic Permissions
IPermissionDefinitionManager
methods are converted to asynchronous, and renamed (added Async postfix).- Removed
MultiTenancySides
from permission groups. - Inherit
MultiTenancySides
enum from byte (default was int). - Needs to add migration for new entities in the Permission Management module.
See https://github.com/vcpframework/vcp/pull/13644 for more info.
External Localization Infrastructure
- Introduced
LocalizationResourceBase
that is base for localization resources.LocalizationResource
inherits from it for typed (static) localization resources (like before). Also introducedNonTypedLocalizationResource
that inherits fromLocalizationResourceBase
for dynamic/external localization resources. We are usingLocalizationResourceBase
for most of the places where we were usingLocalizationResource
before 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="~/Vcp/ApplicationLocalizationScript?cultureName=@CultureInfo.CurrentUICulture.Name"></script>
We've already done this for our themes.
See https://github.com/vcpframework/vcp/pull/13845 for more info.
Replaced BlogPostPublicDto
with BlogPostCommonDto
In the CMS Kit Module,
BlogPostPublicDto
has been moved toVerto.CmsKit.Common.Application.Contracts
fromVerto.CmsKit.Public.Application.Contracts
and renamed toBlogPostCommonDto
.See the PR#13499 for more information.
You can ignore this if you don't use CMS Kit Module.
Data migration environment
Please call AddDataMigrationEnvironment
method in the migration project.
using (var application = await VcpApplicationFactory.CreateAsync<MyMigratorModule>(options =>
{
//...
options.AddDataMigrationEnvironment();
}))
{
//...
}
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDataMigrationEnvironment();
// Call AddDataMigrationEnvironment before AddApplicationAsync
await builder.AddApplicationAsync<MyMigratorModule>();
//...
See https://github.com/vcpframework/vcp/pull/13985 for more info.
Devart.Data.Oracle.EFCore
The Devart.Data.Oracle.EFCore
package do not yet support EF Core 7.0, If you use VcpEntityFrameworkCoreOracleDevartModule(Verto.Vcp.EntityFrameworkCore.Oracle.Devart)
may not work as expected, We will release new packages as soon as they are updated.
See https://github.com/vcpframework/vcp/issues/14412 for more info.
Angular UI
Added a new package @vcp/ng.oauth
OAuth Functionality moved to a seperate package named @vcp/ng.oauth
, so VCP users should add the @vcp/ng.oauth
packages on app.module.ts.
Add the new npm package to your app.
yarn add @vcp/ng.oauth
// or npm i ---save @vcp/ng.oauth
// app.module.ts
import { VcpOAuthModule } from "@vcp/ng.oauth";
// ...
@NgModule({
// ...
imports: [
VcpOAuthModule.forRoot(), // <-- Add This
// ...
],
// ...
})
export class AppModule {}
Fermion X Google-Font
If you are using FermionX that has google fonts, the fonts were built-in the Fermion file. It's been moved to a seperate file. So the VCP user should add font-bundle in angular.json. ( under the 'yourProjectName' > 'architect' > 'build' > 'options' >'styles' )
// for FermionX Lite
{
input: 'node_modules/@verto/ngx-fermion-x.lite/assets/css/font-bundle.rtl.css',
inject: false,
bundleName: 'font-bundle.rtl',
},
{
input: 'node_modules/@verto/ngx-fermion-x.lite/assets/css/font-bundle.css',
inject: false,
bundleName: 'font-bundle',
},
// for FermionX
{
input: 'node_modules/@vertosoft/ngx-fermion-x/assets/css/font-bundle.css',
inject: false,
bundleName: 'font-bundle',
},
{
input: 'node_modules/@vertosoft/ngx-fermion-x/assets/css/font-bundle.rtl.css',
inject: false,
bundleName: 'font-bundle.rtl',
},
Updated Side Menu Layout
In side menu layout, eThemeFermionXComponents.Navbar has been changed to eThemeFermionXComponents.Toolbar, and eThemeFermionXComponents.Sidebar to eThemeFermionXComponents.Navbar.
And also added new replaceable component like Logo Component, Language Component etc.
If you are using replaceable component system you can check documentation.
ng-zorro-antd-tree.css
ng-zorro-antd-tree.css file should be in angular.json if the user uses VcpTree component or Vcp-commercial. The VCP User should add this style definition on angular.json. ( under the 'yourProjectName' > 'architect' > 'build' > 'options' >'styles' )
{ "input": "node_modules/ng-zorro-antd/tree/style/index.min.css", "inject": false, "bundleName": "ng-zorro-antd-tree" },
PRO
Please check the Open-Source (Framework) section before reading this section. The listed topics might affect your application and you might need to take care of them.
If you are a paid-license owner and using the VCP's paid version, then please follow the following sections to get informed about the breaking changes and apply the necessary ones:
"Manage Host Features" Moved to the Settings Page
The "Manage Host Features" button has been moved from Tenants page to the Settings page (under the Feature Management section).
External Localization System in the Language Management Module
External Localization System is introduced in v7.0 to provide a way of accessing localizations in a distributed system. Two new database table are added with this feature: VcpLocalizationResources
and VcpLocalizationTexts
.
Thus, if you are using EF Core, you should add a new database migration and apply it to your database.
In addition to that, LanguageTextConsts.MaxValueLength
is changed from 64 mb to 64 kb.