locked
command line argument RRS feed

  • Question

  • How can I pass an argument to a custom made FxCop rule.

    For ex:

    FxCopCmd.exe /f:"files.dll" /o:"Out.xml" /r:-"Rules.dll" /myargument:true/false
    Thursday, November 26, 2009 8:34 AM

Answers

  • FxCopCmd.exe screens its command line arguments against an internal list of allowed switches, so you cannot use a custom command line switch to configure your rule.

    There is, however, a mechanism for configuring rules.  First, the rule should implement Microsoft.FxCop.Sdk.IConfigurableRule.  Once this is done, you can configure the rule in an FxCop project file, which can be loaded via the /project command line switch supported by FxCopCmd.exe.
    • Marked as answer by liurong luo Thursday, December 3, 2009 10:15 AM
    Monday, November 30, 2009 5:48 PM

All replies

  • Hello Alevon,

    Would you please tell us what is our achievement? If we want to run FxCopCmd.exe right after we build our project, we could use Post-Build event (Property page -> Build Events).

    Best regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    Friday, November 27, 2009 5:04 AM
  • FxCopCmd.exe screens its command line arguments against an internal list of allowed switches, so you cannot use a custom command line switch to configure your rule.

    There is, however, a mechanism for configuring rules.  First, the rule should implement Microsoft.FxCop.Sdk.IConfigurableRule.  Once this is done, you can configure the rule in an FxCop project file, which can be loaded via the /project command line switch supported by FxCopCmd.exe.
    • Marked as answer by liurong luo Thursday, December 3, 2009 10:15 AM
    Monday, November 30, 2009 5:48 PM