Can someone help me understand why I am unable to get the "Url" property from this example? I get the error "Field or Property 'Url' does not exist":

        ClientContext ctx = new ClientContext("http://<weburl>");
        WebCollection allWebs = ctx.Web.Webs;

        var webCollection = ctx.LoadQuery(
                web => web.Title,
                web => web.ServerRelativeUrl,
                web => web.Url            

        foreach (Web w in webCollection)
            //w.ServerRelativeUrl returns a value, but
            //w.Url gives me an error. why?

2 Answers 2


This error occurs since you are using SharePoint Server 2013 Client Components SDK (ver. 15) or SharePoint Online Client Components SDK (ver. 16) but against SharePoint 2010.

Microsoft.SharePoint.Client.Web Url Property was introduced in CSOM ver. 15

How to determine Web Url in SharePoint 2010

The following example demonstrates how to get sub webs url in SharePoint 2010:

var webs = ctx.LoadQuery(
                web => web.Title,
                web => web.ServerRelativeUrl
ctx.Load(ctx.Site, s => s.Url);

foreach (Web web in webs)
    var webUrl = ctx.Site.Url + web.ServerRelativeUrl;

URL is not a property of Microsoft.SharePoint.Client.Web however, ServerRelativeUrl is.


What are you trying to accomplish?

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.