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
I'm currently running through the CMS training content with AlloyDemo, and I'm currently getting a server error for this line:
In addition, I'm getting a similar error for other classes when commenting out Administrator Registration. This happens whenever
provideris null, given by the line: