Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Referencing a site in Timer Job

$
0
0
Hello,
I am a bit confused with SharePoint URLs. I enter the site by address http://abcuniversity/ in Internet Explorer. I need to read the lists from that site in a Timer Job. I use the following code:               
        public override void Execute(Guid targetInstanceId)
        {
            using (SPSite site = new SPSite("http://abcuniversity/"))
            {
               using (SPWeb web = site.OpenWeb())
                { ...
However the site is null when debugging. What is wrong in that code?
Thanks,
Radek

Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>