SC9: MediaManager no Provider property
Closed this issue · 2 comments
The MediaManager in SC9 no longer has a Provider property:
Error : Glass.Mapper.Sc.FakeDb.GlassHtmlFixture.RenderLink_LinkWithMixedPropertiesAndParameters
System.MissingMethodException : Method not found: 'Sitecore.Resources.Media.MediaProvider Sitecore.Resources.Media.MediaManager.get_Provider()'.
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
at Sitecore.FakeDb.Resources.Media.MediaProviderSwitcher..ctor(MediaProvider innerProvider)
at Glass.Mapper.Sc.FakeDb.GlassHtmlFixture.Setup() in E:\github\Glass.Mapper\Tests\Unit Tests\Glass.Mapper.Sc.FakeDb\GlassHtmlFixture.cs:line 57
--TearDown
at Glass.Mapper.Sc.FakeDb.GlassHtmlFixture.TearDown() in E:\github\Glass.Mapper\Tests\Unit Tests\Glass.Mapper.Sc.FakeDb\GlassHtmlFixture.cs:line 66
This can be seen in the following build:
Unfortunatelly FakeDb cannot help here. I'll restore my premature commit as soon as Sitetecore 9 is publicly available.
The recomendation is to stop using FakeDb MediaProviderSwitcher
and use new Sitecore abstract class Sitecore.Abstractions.BaseMediaManager
. You may find some tips how to achieve that here and here.
Marked as obsolete in v1.7.4. Removed in v2.