Fixing obsolete constructor ContentValueSetValidator
a
I've just upgraded to V12, and this warning is currently showing up, I dislike warnings. https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Infrastructure/Examine/ContentValueSetValidator.cs#L44 I'm not sure on how to fix this, I can change my reference from
using Umbraco.Cms.Core.Scoping;
to
using Umbraco.Infrastructure.Scoping
which fixes the warning, however my code for
new ContentValueSetValidator(arguments)
still requires the scopeProvider from
Core.Scoping
. Is this fixable, or can this only be solved when upgrading to v14 as no separate constructor seems to exists?
d
Heyo!! Usually if something is obsolete, there is an alternative available. You say that in this case, there is no alternative, so assuming that there is no alternative, you might be able to fix your issue by marking your own constructor as obsolete as well.
a
But that would create a new warning 😄
d
Interesting, I just tried it and marked a method as obsolete. There's no warning on the method itself, only on calls to that method. Do you explicitly call your constructor somewhere? I wouldn't expect warnings if you just register your type in dependency injection (unless you marked the whole type as obsolete)
a
Hmm, you're right
Would have to make note of the obsolete methods somewhere though
Thanks for assisting 🙂
14 Views