Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have this piece of code:

        using (SPSite site = DetectContextSite())
        {
            using (SPWeb web = site.OpenWeb())
            {
                using (var dc = new DataContext(web.Url))
                {
                    var news = dc.GetList<ArticlePage>(this.ListName);
                    if (news != null)
                    {
                        DateTime now = DateTime.Now;
                        var result = news.ScopeToFolder(this.FolderName, true)
                                            .Where(n => n.PublishingStartDate <= now && n.PublishingEndDate >= now)
                                            .OrderByDescending(n => n.PublishingStartDate);
                        if (result != null)
                        {
                            if (result.Count() > this.NumberOfLatestNews)

that works when the logged user is an Owner but crash, during the Count method, when the user has only a visitor or member permission. The error is: Thread was being aborted

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.