With CSOM, how can I test if a web is the container for a SharePoint hosted app, equivalent of SPWeb.IsAppWeb?

  • 1
    Actually looking for the same thing myself right now. one thing I've found: web.get_appInstanceId() will return the guid of the installed app or "00000000-0000-0000-0000-000000000000" if it's a normal web. – mabene Nov 26 '14 at 13:49
  • This is a good suggestion. Looking at the documentation it seems like a viable approach. Thanks! – rlv-dan Dec 1 '14 at 6:20

This is the implementation of SPWeb.IsAppWeb (via Reflector)

public bool IsAppWeb
        return (this.AppInstanceId != Guid.Empty);
  • Kinda makes you wonder why they couldn't have implemented that in CSOM #hmmmm – Rob Windsor May 26 '15 at 18:32

You can look at the WebTemplate property of the Web object. The WebTemplate value will be "APP" if it is an App Web.

// Exclude any App Webs
if (subweb.WebTemplate.Equals("APP")) continue;

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.