1

I'm trying to share a file which is located in my OneDrive for Business using the SharePoint CSOM library including PNP external sharing library. This however, returns the following error message:

CrossSiteRequestNotSupported

MountPoint security error: host web isn't a personal site

The code I'm using to produce this error is:

var profileLoader = ProfileLoader.GetProfileLoader(ctx);
UserProfile profile = profileLoader.GetUserProfile();
Site personalSite = profile.PersonalSite;
ctx.Load(personalSite);
ctx.ExecuteQuery();
rootWeb = personalSite.RootWeb;
ctx.Load(rootWeb);
ctx.ExecuteQuery();
rootWeb.ShareDocument(id, email, ExternalSharingDocumentOption.View, true); 
1
  • Please provide the relevant parts of your code, so we can get a better insight.
    – jcp
    Oct 23 '15 at 15:14
2

I've figured out what my problem was. I had an error in my tenant URL.

At first it was:

 https://<tenant>.sharepoint.com/

Which works for sharing documents within our SharePoint teamsite. For sharing documents in the Personal OneDrive for Business however, I had to adjust the URL to the following:

https://<tenant>-my.sharepoint.com

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.