When updating the reference of our project from 5 to 6 of Xtensive.Orm.Security, we have an exception during the upgrade of the domain (see below). What would be the step to properly upgrade from version '5.0.0.0' to '6.0.0.0' Xtensive.Orm.Security ?

Is an UpgradeHandler missing in the assembly Xtensive.Orm.Security ?

Or should the Xtensive.Orm.Security assembly be not included in the model when building the Domain in the first place ? (if so why relations are stored in the domain (using 5.0.0 in table Xtensive.Orm.Security.IPrincipal-Roles-Xtensive.Orm.Security.IRole)

Many thanks,

Xtensive.Orm.DomainBuilderException: Upgrade of assembly 'Xtensive.Orm.Security' from version '5.0.0.0' to '6.0.0.0' is not supported. at Xtensive.Orm.Upgrade.SystemUpgradeHandler.CheckAssemblies() at Xtensive.Orm.Upgrade.SystemUpgradeHandler.OnBeforeStage() at Xtensive.Orm.Upgrade.UpgradingDomainBuilder.OnBeforeStage() at Xtensive.Orm.Upgrade.UpgradingDomainBuilder.PerformUpgrade(Domain domain, UpgradeStage stage) at Xtensive.Orm.Upgrade.UpgradingDomainBuilder.BuildMultistageDomain() at Xtensive.Orm.Upgrade.UpgradingDomainBuilder.Run() at Xtensive.Orm.Upgrade.UpgradingDomainBuilder.Build(DomainConfiguration configuration)

Note, I worked around the issue by setting the assembly version manually to 6.0.0.0 instead of 5.0.0.0:

UPDATE [dbo].[Metadata.Assembly] SET [Version] = '6.0.0.0' WHERE [Name] = 'Xtensive.Orm.Security'

asked Jul 16 '20 at 09:06

rle's gravatar image

rle
99559

edited Jul 17 '20 at 02:29


One Answer:

Hello rle,

There is no UpgradeHandler in Xtensive.Orm.Security (as well as in other extensions with entities). Since the only thing is changed is version the easiest way to upgrade it is to add an UpgradeHandler allowing such upgrade for this assembly. UpgradeHandler allows to override needed properties and methods. For example


public class SecurityUpgradeHandler : UpgradeHandler
  {
    public override Assembly Assembly => typeof (Xtensive.Orm.Security.IRole).Assembly;

    public override string AssemblyName => this.Assembly.GetName().Name;

    public override bool CanUpgradeFrom(string oldVersion)
    {
      return true;
    }
  }

Don't exclude Xtensive.Orm.Security form types.

answered Jul 22 '20 at 09:00

Alexey%20Kulakov's gravatar image

Alexey Kulakov
77225

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA