1

This question already has an answer here:

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?

marked as duplicate by Robert Lindgren Aug 11 '14 at 9:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

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