Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3695868
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:40:11+00:00 2026-05-19T04:40:11+00:00

I am testing FxCop automation and want to validate it is screening and catching

  • 0

I am testing FxCop automation and want to validate it is screening and catching certain rules. I want to make a dll that will trigger the AvoidCallingProblematicMethods error in FxCop.

I have the following code but it is not triggering the AvoidCallingProblematicMethods rule at all. what am i doing wrong?

// use one of the listed unsafe methods to create a problematic method
// http://msdn.microsoft.com/en-us/library/bb385973.aspx for list of offending methods
GC.Collect();

how can i trip this FxCop Rule?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:40:12+00:00Added an answer on May 19, 2026 at 4:40 am

    Did you analyze not with Visual Studio Code Analysis, but with the stand-alone FxCop?

    If so, your code isn’t checked because FxCop doesn’t support the AvoidCallingProblematicMethods rule.

    To be more exact, FxCop doesn’t contain Reliability and Maintainability rules. The AvoidCallingProblematicMethods rule is categorized as a Reliability rule.

    You can see a comparison table of code analysis rules supported by VS Code Analysis and FxCop from here.

    UPDATE

    As you will see in Pedro’s comment, you can use this rule in FxCop, if you copy VS2010 code analysis rules to FxCop Rules directory.

    1. Backup assemblies in FxCop Rules
      directory (“%PROGRAMFILES%\Microsoft
      FxCop 10.0\Rules” by default).
    2. Copy assemblies in
      “%PROGRAMFILES%\Microsoft Visual
      Studio 10.0\Team Tools\Static
      Analysis Tools\FxCop\Rules” to FxCop
      Rules directory, except
      DataflowRules.dll (FxCop can’t load
      rules from DataflowRules.dll).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I make a distributed embedded application that will make use of several micro-controllers. The
We manage a site for a medical charity. They have a number of links
I am attempting to pull some information from my tnsnames file using regex. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.