2

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?

1 Answer 1

5

This should do the trick:

var domain = Sitecore.SecurityModel.DomainManager.GetDomain("extranet");
domain.GetUsers()
3
  • In that case, don't forget to accept the answer ;)
    – Gatogordo
    Commented Feb 20, 2019 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. Commented Feb 22, 2019 at 5:48
  • I'm not aware of any link or resources.. We are creating that documentation here :)
    – Gatogordo
    Commented Feb 22, 2019 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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