0

If I understand correctly , each SP site has it's own 128 bit generated unique id. Is it possible, in CSOM, to do something like:

ClientContext context = new ClientContext('128-bit-generated-id');

Or anything equivalent?

3

It's is not possible. The only ways to do this are:

  1. ClientContext(String) - Initializes a new instance of the ClientContext class for the SharePoint site with the specified absolute URL.
  2. ClientContext(Uri) - Initializes a new instance of the ClientContext class for the site with the specified Uri object.

Link to source

But you can use Site.OpenWebById() and get web by GUID

0

i think this is not possible bcz there is no options available for guid in parameter values

enter image description here

Here is no options available for guid in parameter values

you need to provide full url as a stirng or Uri form

Example for pass url as a string format

ClientContext ctx = new ClientContext("full web url");

Example for pass url a Uri format

Uri uri=new Uri("web full url")
ClientContext ctx = new ClientContext(Uri);

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.