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

Unable to debug WCF service which reads SharePoint 2013 list

$
0
0

using (SPSite site = new SPSite("http://LocalSPServer:1000/", SPUserToken.SystemAccount))
                {
                    using (SPWeb web = site.OpenWeb())
                    {
                        var list = new List<QuarterlyIncidents>();
                        SPList lstQIncidents = web.Lists["QuarterlyIncidents"];

                        if (lstQIncidents != null)
                        {
                            var result = (from SPListItem i in lstQIncidents.Items
                                          orderby i.ID
                                          where lstQIncidents.ID != null
                                          select new
                                          {
                                              i.ID,
                                              i.Title,
                                              i.UniqueId

                                          }
                                        );

                            foreach (var item in result)
                            {
                                var resItem = new QuarterlyIncidents();
                                resItem.IncidentCount = item.ID;
                                resItem.SectorName = item.Title;
                                list.Add(resItem);
                            }

                            return list;
                        }
                    }
                }

I am reading data from SharePoint list in a WCF service using server object model. I can consume this simple service hosted in same SP server and get the data but for further complex read write operations I want to debug. I tried to debug but breakpoint does not hit.

Both app pool user is system account(Farm account).

Any clue, I checked changing platform from X86 to x64 but did not help.



Viewing all articles
Browse latest Browse all 7589

Trending Articles



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