I have my UpgradeHandler written in the Model assembly. In order to organize my code better I moved it to a Services assembly.

Then I got the message that I can not upgrade to a newer schema version. I set breakpoints in my UpgradeHandler class constructor and CanUpgradeFrom method.

I found out that constructor was called (I conclude that my handler was found and recognized) but then I saw that my CanUpgradeFrom wasn't called, meanwhile my scheme cannot be upgraded with a stack trace:

Xtensive.Orm.DomainBuilderException: Upgrade of assembly 'GRC.Model' from version '1.45.1187.13623' to '1.45.0.0' is not supported. в Xtensive.Orm.Upgrade.SystemUpgradeHandler.CheckAssemblies() в Xtensive.Orm.Upgrade.SystemUpgradeHandler.OnBeforeStage() ....

How would you recommend me to debug this issue of mine? Is there a default upgrade handler that got executed and did return false?

asked Sep 10 '18 at 08:02

Kirill's gravatar image

Kirill
9224


One Answer:

Hello Kirill,

Look at the properties of UpgradeHandler. There are Assembly and AssemblyName property, By default they return the assembly where the UpgradeHandler is declared and the assembly name, but you can write your own algorithm because they are virtual.

When your Upgrade handler was in the Model assembly everything worked fine because these two properties returned Model assembly and its name, when you moved it to Services these two properties started returning Services assembly and its name. By implementing the properties you can make it work correctly and return Model assembly.

answered Sep 10 '18 at 08:43

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

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×5

Asked: Sep 10 '18 at 08:02

Seen: 2,679 times

Last updated: Sep 10 '18 at 08:43

powered by OSQA