gpt4 book ai didi

dictionary - 如何让 FxCop 自定义词典发挥作用?

转载 作者:行者123 更新时间:2023-12-03 07:04:18 24 4
gpt4 key购买 nike

如何才能使 FxCop 自定义词典正常工作?

我尝试将要识别的单词添加到文件“CustomDictionary.xml”中,该文件与 FxCop 项目文件保存在同一文件夹中。这似乎不起作用,因为即使在重新加载并重新运行 FxCop 后,我仍然收到“标识符应正确拼写”FxCop 消息。使用版本1.36。

最佳答案

如果您在 Visual Studio 中使用它...

来自Visual Studio Code Analysis Team Blog

To add a custom dictionary to a C# and Visual Basic project is simple:

  1. In Solution Explorer, right-click on the project and choose Add -> New Item...
  2. Under Templates, select XML File, enter a name for the dictionary, such as CodeAnalysisDictionary.xml and click Add
  3. In Solution Explorer, right-click on the XML file and choose Properties
  4. In the Properties tool window, under Build Action choose CodeAnalysisDictionary
  5. In Solution Explorer, double-click on the newly created dictionary to open it
  6. In the XML editor, paste the following, replacing "productname" and "companyname" with your team's equivalents:

    <Dictionary>
    <Words>
    <Recognized>
    <Word>"productname"</Word>
    <Word>"companyname"</Word>
    </Recognized>
    </Words>
    </Dictionary>

You are now ready to start entering your own custom words. Simply add a new element for each word in your project that does not exist in the dictionary. Each word is case-insensitive, so any casing of the word will be recognized. Code Analysis will automatically pick up the custom dictionary the next time it is run.

关于dictionary - 如何让 FxCop 自定义词典发挥作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/359290/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com