Hi,
Having an UpgradeHandler cause an exception in RecreateMode: is something wrong, or is this a bug?
I've joined a simple sample : [attachment=0:30why9qa]DOSample.zip[/attachment:30why9qa]
Edit: exception thrown
L'exception System.MethodAccessException s'est produite
Message=".Create()"
Source="Anonymously Hosted DynamicMethods Assembly"
StackTrace:
à Create()
à Xtensive.Core.IoC.ServiceContainer.CreateInstance(ServiceRegistration serviceInfo)
à Xtensive.Core.IoC.ServiceContainer.<GetOrCreateInstances>d__2.MoveNext()
à System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
à System.Linq.Enumerable.<CastIterator>d__aa`1.MoveNext()
à System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
à System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
à System.Linq.Lookup`2.Create[TSource](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
à System.Linq.GroupedEnumerable`3.GetEnumerator()
à Xtensive.Storage.Upgrade.UpgradeContext.BuildUpgradeHandlers()
à Xtensive.Storage.Upgrade.UpgradeContext..ctor(DomainConfiguration originalConfiguration)
à Xtensive.Storage.Upgrade.UpgradingDomainBuilder.Build(DomainConfiguration configuration)
à Xtensive.Storage.Domain.Build(DomainConfiguration configuration)
à ...
Regards,
Updated at 16.04.2010 9:30:54
Yes the sample I posted runs with a public Upgrader class.
A more specific exception would be a good idea.
By the way, why do you search the Upgrader classes on recreate?
Updated at 19.04.2010 8:56:37
That's OK for me. Besides it makes sense to check Upgrader type are correctly defined even in Recreate mode, so that we can spot an error as soon as possible when coding.
This thread was imported from our support forum. The original discussion may contain more detailed answer.
asked
Apr 15 '10 at 16:07
olorin
358●87●87●92
I just don't want to touch the code that works ;)
Concerning exception message - true, this must be fixed.
> By the way, why do you search the Upgrader classes on recreate?
Just because there is a generic logic responsible for this. Not sure if it's necessary to fix this - i.e. does this lead to any issues?
Most likely cause: class Upgrader must be public.
Hello olorin,
We'll check the issue with IoC behavior and the necessity of searching for Upgraders in Recreate mode. At first glance, the latter one seems to be redundant.