0

I have the following comment.

    /// <summary>
    /// MSDN Time Format compatible with <see cref="DateTime.ParseExact(string, string, IFormatProvider)"/> 
    /// </summary>
    /// <returns>MSDN Time Format compatible with <see cref="DateTime.ParseExact(string, string, IFormatProvider)"/></returns>

but I'm not sure why I receive the following warning

Warning 7 XML comment on 'MSLab.DateTime.SystemTimeProvider.GetTimeFormat()' has cref attribute 'DateTime.ParseExact(string, string, IFormatProvider)' that could not be resolved F:\My Documents\Visual Studio 2010\Projects\MSLab\trunk\MSLab\MSLab\DateTime\SystemTimeProvider.cs 110 57 MSLab

2
  • I copied your code and couldn't reproduce the error. Do you have a using System;? Commented Aug 31, 2012 at 3:19
  • Michael Liu caught it as it was very subtle (but right in my face). I have an MSLab.DateTime namespace which was conflicting. It's too bad the warning message did not say "ambiguous" like it does when compiling code in such a manor. Commented Aug 31, 2012 at 3:43

1 Answer 1

1

Based on the warning message, it looks like your SystemTimeProvider class is inside a namespace named DateTime, which has the same name as the .NET DateTime type. To resolve this conflict, change your cref to "System.DateTime.ParseExact(string, string, IFormatProvider)":

/// <summary>
/// MSDN Time Format compatible with <see cref="System.DateTime.ParseExact(string, string, IFormatProvider)"/>
/// </summary>
/// <returns>MSDN Time Format compatible with <see cref="System.DateTime.ParseExact(string, string, IFormatProvider)"/></returns>
Sign up to request clarification or add additional context in comments.

1 Comment

Wow I banged my head for a while and I never even noticed. That namespace needs to be renamed me thinks. Either way providing the fully qualified name did the trick. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.