#Fixing obsolete constructor ContentValueSetValidator

1 messages · Page 1 of 1 (latest)

tight abyss
#

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?

GitHub

The simple, flexible and friendly ASP.NET CMS used by more than 730.000 websites - umbraco/Umbraco-CMS

safe vigil
#

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.

tight abyss
safe vigil
#

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)

tight abyss
#

Hmm, you're right

#

Would have to make note of the obsolete methods somewhere though