imsan
imsan

Reputation: 469

Intelli sense not showing for custom methods with xml comments

I have an interface with XML comments on

namespace NamespaceName.Core.Services
{
    public interface ITransaction : IDisposable
    {
        /// <summary>
        /// Sends message into the given queue, optionally at the scheduled time provided
        /// </summary>
        /// <param name="queueName">Name of the queue to send message to</param>
        /// <param name="message">The message to send</param>
        /// <param name="messageId">Id of the message to send</param>
        /// <param name="enqueueDateTime">Optional date & time to enqueue the message at, MUST be in UTC</param>
        Task SendMessageAsync(string queueName, object message, string? messageId = null, DateTime? enqueueDateTime = null);
    }
}

then the method

namespace NamespaceName.Core.Services
{
  public class MessageService : IMessageService, IDisposable, IAsyncDisposable
  {
    private sealed class Transaction : ITransaction
    {
      /// <inheritdoc cref="ITransaction.SendMessageAsync(string, object, string?, DateTime?)"/>
      public async Task SendMessageAsync(string queueName, object message, 
      string? messageId = null, DateTime? enqueueDateTime = null) {...}
    }
  } 
}

when using the method I would expect to see the comments in intelli sense but they are not there, instead the message is just 'Intellicode suggestion based on the current context' intelli-sense message

This is in Visual Studio 2022 and I have restarted visual studio which didn't help. This works as expected in a different project in the same solution.

Any idea what needs to be done to get this to work?

(the project it works in is a console app while the one it doesn't work in is a web app incase that's of relevance)

Upvotes: 0

Views: 440

Answers (1)

Jingmiao Xu-MSFT
Jingmiao Xu-MSFT

Reputation: 2327

We can see from this page(https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/recommended-tags#param ) that “The names for parameters must match the API signature”

In your code use queue.QueueName but in xml comment define .

In my test, if just use queueName intellisense can show prama defined in xml comments. But if I get the parameter like queue.QueueName it only shows 'Intellicode suggestion based on the current context'

Upvotes: 0

Related Questions