1

I have a problem of

value does not fall within the expected range

from below code.

 string webUrl = "/_layouts/15/wfcourrierdep/ArticlesList.aspx";
 string fullpath = SPUtility.GetFullUrl(SPContext.Current.Site,webUrl);           
 SPFile file = web.GetFile(fullpath);

What can the cause be?

0

Please update your "webUrl" variable to be Server Relative. webUrl = "/sites/sitename/_layouts/15/wfcourrierdep/ArticlesList.aspx";

string fullpath = SPUtility.GetFullUrl(SPSite, serverRelativeURL);

Reference http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.getfullurl(v=office.15).ASPX

| improve this answer | |

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