【问题标题】:Named Parameters in C# 4 and IntellisenseC# 4 和 Intellisense 中的命名参数
【发布时间】:2011-06-27 01:10:57
【问题描述】:

我是否正确地说在 Visual Studio 2010 中没有针对 C# 4 命名参数的 Intellisense。

例如,如果我有以下方法签名:

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

当我在方法调用中输入参数名称时,我原以为我会得到 Intellisense。

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

或者这是不可能的,因为如果您按位置指定参数,Intellisense 会妨碍?

【问题讨论】:

  • 我得到了 Intellisense。
  • 他们出现在我面前...但我使用 ReSharper。

标签: c# .net parameter-passing named-parameters


【解决方案1】:

不,你不对……我不知道你在说什么,但他们确实出现了。

【讨论】:

    【解决方案2】:

    您的智能设置可能有问题,请参阅这篇文章:

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

    如果问题仍然存在,请尝试修复或重新安装 Visual Studio。

    【讨论】:

      猜你喜欢
      • 2020-01-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多