Just a theoretical question for now : How can I remove an assembly from an existing domain?

Let's say after some refactor persistent types are moved to another assembly, or I want to remove a plugin assembly from an existing domain. In that case we will want to remove this assembly from domain on upgrade (with removal of tables from this assembly)

I think it is not supported for now : I had this situation by accident and got an exception "Upgrade Handler not found". (By the way this message is not very clear)

Will this be possible in the future? (4.4 ?) Could you fix the message to get a more readable exception if a needed assembly is missing from the domain?

It is not an important feature, but in my opinion it is needed to get full upgrade path.

asked Nov 04 '10 at 09:32

olorin's gravatar image

olorin
356808489


One Answer:

This is supported - to do this, you must implement UpgradeHandler for this assembly in some other assembly you register, or pass it to Domain.Configuration.RegisterTypes(...) method directly.

To state this is upgrade handler for another assembly, you must override its:

  • AssemblyName property - it must return the name of target assembly
  • AssemblyVersion property - it must return the latest version of target assembly, or you must override CanUpgradeFrom method as well.

This will ensure the handler will be found.

Is it a good idea to add a hint for this case to simplify this?

answered Nov 06 '10 at 05:21

Alex%20Yakunin's gravatar image

Alex Yakunin
29713412

P.S. Decompiling UpgradeHandler with .NET Reflector should explain how its default implementation works. It's a actually a pretty simple type.

(Nov 06 '10 at 05:22) Alex Yakunin Alex%20Yakunin's gravatar image

I don't think it is necessary to add an hint for this. However more documentation would be welcomed.

(Nov 08 '10 at 03:05) olorin olorin's gravatar image
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