We recently upgraded our project to Sitecore9 initial release from 7.2. We were re-compiling our code including latest Sitecore.Kernel. We got this error:

error CS0117: 'Factory' does not contain a definition for 'GetDomain'

for below code:

var domain = Sitecore.Configuration.Factory.GetDomain("extranet");
var allUsers = domain.getUsers();

There is no GetDomain function in Configuration.Factory. I think it got replaced by GetDomainMap. But that doesn't have getUsers() function. Can someone help us how to resolve this?


This should do the trick:

var domain = Sitecore.SecurityModel.DomainManager.GetDomain("extranet");
  • In that case, don't forget to accept the answer ;)
    – Gatogordo
    Feb 20 '19 at 12:30
  • By the Way, Is there any link which have new api's and their methods? or any trick to resolve such errors. Basically I have to resolve the way api handling in 9 version. Feb 22 '19 at 5:48
  • I'm not aware of any link or resources.. We are creating that documentation here :)
    – Gatogordo
    Feb 22 '19 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.