Skip to content

System.ArgumentOutOfRangeException: CommentCop.Misc.MR8000XMLCommentMustBePreceededByBlankLine #1

Description

@WizX20

Example of the class in question:

`
namespace Project.Foundation.SitecoreExtensions.Abstractions
{
using System.Collections.Generic;
using System.Linq;
using Sitecore.Data;
using Sitecore.Data.Items;

///


/// Represents a wrapper around an actual Sitecore data .
///

public class SitecoreTemplateItem : /CustomItemBase,/ ISitecoreTemplateItem
{
private readonly TemplateItem _item;

    /// <summary>
    /// for mocking purposes only
    /// </summary>
    public SitecoreTemplateItem()
    {
        // for mocking purposes only
    }
    /// <summary>
    /// Creates a wrapper around an actual Sitecore data <see cref="TemplateItem"/>.
    /// </summary>
    public SitecoreTemplateItem(TemplateItem templateItem)// : base(templateItem.InnerItem)
    {
        this._item = templateItem;
    }

    /// <summary>
    /// Gets a list of base templates.
    /// </summary>
    public virtual IEnumerable<SitecoreTemplateItem> BaseTemplates
    {
        get { return this._item.BaseTemplates.Select(ToSitecoreTemplateItem); }
    }

`

Exception:
`
Severity Code Description Project File Line Suppression State Detail Description
Error AD0001 Analyzer 'CommentCop.Misc.MR8000XMLCommentMustBePreceededByBlankLine' threw an exception of type 'System.ArgumentOutOfRangeException' with message 'Specified argument was out of the range of valid values.
Parameter name: index'. Onvz.Foundation.SitecoreExtensions 1 Active Analyzer 'CommentCop.Misc.MR8000XMLCommentMustBePreceededByBlankLine' threw the following exception:
'Exception occurred with following context:
Compilation: Onvz.Foundation.SitecoreExtensions
SyntaxTree: C:\Projects\OSP\src\foundation\SitecoreExtensions\code\Abstractions\SitecoreTemplateItem.cs
SyntaxNode:


Creates a wrapper around an actual Sitecore data ... [DocumentationCommentTriviaSyntax]@[641..767) (21,11)-(24,0)

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at Microsoft.CodeAnalysis.SyntaxTriviaList.get_Item(Int32 index)
at CommentCop.Misc.MR8000XMLCommentMustBePreceededByBlankLine.Check(SyntaxNodeAnalysisContext syntaxNodeAnalysisContext)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass42_11.<ExecuteSyntaxNodeAction>b__1() at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze, Nullable1 info)

'.
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions