I'm currently running through the CMS training content with AlloyDemo, and I'm currently getting a server error for this line:
Object reference not set to an instance of an object.
Line 57: var res = provider.GetAllUsers(0, 1, out totalUsers);
In addition, I'm getting a similar error for other classes when commenting out Administrator Registration. This happens whenever provider is null, given by the line:
var provider = ServiceLocator.Current.GetInstance<UIUserProvider>();Does anybody know why ServiceLocator would return null? This happened sort of out of the blue. Everything worked fine on February 6th.Thank you!
var provider = ServiceLocator.Current.GetInstance<UIUserProvider>();
There is a line there that enables .net identity for Episerver. My best guess is that you accidentally removed that. That would cause an error like you described.
Make sure that you still have AddCmsAspNetIdentity called in your code. This is where it registers UIUserProvider
As a side note, you should try to use constructor injection instead of ServiceLocator