Search code examples
c#.netparameter-passingnamed-parameters

Named Parameters in C# 4 and Intellisense


Am I right in saying there is no Intellisense for C# 4 named parameters in Visual Studio 2010.

For example if I have the following method signature:

public static List<Person> GetPerson(string personId = null, string postCode = null, string lastName = null)

I would have thought I'd get Intellisense as I typed in the parameter names in the method call.

List<Person> people = GetPersons(personId : "abc", [Intellisense appear as I type p..] 

Or is this not possible because Intellisense would get in the way if you were specifying parameters by position?


Solution

  • Something might have messed with your intellisence settings, see this post:

    http://blog.meidianto.com/2010/05/10/vs2010-tips-5-no-intellisense-in-visual-studio-2010-fix-it-now/

    If your problems persist, attempt a repair or reinstall of Visual Studio.