In my timer job code, there is a section where for each site collection in the web application, I am reading an XML template file in the style library of that site collection.
The code looks something like
var xmlDoc = new XmlDocument();
xmlDoc.Load(site.Url + "/style%20library/xml/test-template.xml");
The error I'm getting is
The remote server returned an error: (401) Unauthorized.
What would I need so that my timer job has access to this file in the style library?
The account used on execution is SHAREPOINT\SYSTEM
by the way.
site.Url
resolves to http://mySpSite/siteCollection/