Questions tagged [fxcop]

Microsoft's free static analysis tool for analyzing .NET managed code assemblies.

FxCop can be used to find coding design issues quickly and early, comes with switchable rulesets, and supports the creation of custom rules.

Available with certain versions of Visual Studio and as part of the Windows 7 SDK, available here.

749 questions
0
votes
1 answer

FxCop not working in TeamCity

While running FxCop as Build Step in Team City getting following error: * Analysis was not performed; at least one valid rules assembly and one valid target file must be specified. However, all Rules Dll's are loaded. Here is the error…
Apoorve
  • 1
  • 1
0
votes
3 answers

FxCop command line and paths with spaces

I'm having problems getting the FxCop command line to work when I specify paths with spaces in them. Yes, I use the quotes properly. M:\build\IOService\src>"c:\Program Files\Microsoft FxCop 1.36\FxCopCmd.exe" /c /f:".\My Library\bin\Release\"…
rev
  • 1,681
  • 2
  • 13
  • 21
0
votes
2 answers

Would like to integrate fxcop 10.0 and StyleCop 4.7 with TortoiseSVN 1.7.6 through pre-commit hook script

For FxCop Integration with SVN, Requirement: Whenever, a developer tries to checkin the code in SVN, Fxcop should run and check if all files are as per rules or not. If not, then file commit should not be allowed in SVN. Implementation: Added a…
Apoorve
  • 1
  • 1
0
votes
1 answer

Custom FxCop rules to check attributes in MVC application

Is there a reasonably simple way to get FxCop to check whether there is any usage of ViewBag, ViewData in MVC application.
SCP
  • 63
  • 1
  • 7
0
votes
1 answer

fxcop custom rule is not working

I have created the custom rule using Microsoft FxCop 1.36 in visual studio 2010 and I pasted the custom rule dll in the C:\Program Files\Microsoft FxCop 1.36\Rules folder. Then I opened Microsoft Fxcop. I am getting error as the following.. Unable…
Kavya Reddy
  • 5
  • 1
  • 4
0
votes
0 answers

Has FxCop been removed from the Windows SDK for Windows 7?

I have been searching high and low for the definitive answer as to how to get hold of the latest version of FxCop and despite the release notes saying: 6.3.6 FXCop Setup is Now Located Under the Window SDK “\Bin” Directory. The installer for…
Keith
  • 719
  • 4
  • 8
0
votes
2 answers

Running FxCop directly through VS project file

I am interested in setting up FxCop to run on each of our VS .csproj files in our developing environment by calling it as a target in the .csproj file itself without creating a separate MSBuild file for the project. Is this
kd7iwp
  • 3,110
  • 8
  • 30
  • 39
0
votes
1 answer

Avoid fxcop error CA1004 in this case

I have a case where it is returning objects of type T. My code looks like this. public static T GetObjectsFromWebRequest(string urlPath) where T : class { T modelObjects; try { …
user2160052
0
votes
2 answers

Why don't analysis tools apply refactorings?

I am using fxCop and NDepend a lot at the moment, and I keep seeing the items their reports generate which are "wrong"1 and wondering to myself, why can't these tools just go and make those fixes they are suggesting? I get some are very hard to…
Robert MacLean
  • 38,975
  • 25
  • 98
  • 152
0
votes
1 answer

ExpandoObject causes rule violation CA1502:Avoid excessive complexity

I have code that performs a mail merge type operation, and I am using dynamic/ExpandoObject to assemble the properties. I am doing this instead of building an anonymous class because different methods along the way add properties before the mail…
CodeGrue
  • 5,865
  • 6
  • 44
  • 62
0
votes
3 answers

Issues setting up StyleCop and FXCop with Jenkins

I have installed the Jenkins Violations plugin v0.7.11 and I am having an issue getting it to display FXCop and StyleCop violations. In the settings I have entered the recommended XML filename pattern as: **/*/FxCopViolations.xml…
magritte
  • 7,396
  • 10
  • 59
  • 79
0
votes
2 answers

TeamCity Send Email FxCop Notification

I currently have FxCop integrated as a build step on one of my TeamCity projects. It runs after the build and outputs errors. It's working great. However what I really want is to have it email me an overview of the errors each time it runs so that…
aherrick
  • 19,799
  • 33
  • 112
  • 188
0
votes
1 answer

513 Error Code (exit code) FxCop using C#

I have VS2010, Windows 7 bits, FxCop 10.0 I execute Fxcopcmd.exe using Process.Start, and I get 513 "exitcode" (error code) value. Todd King in below reference says: In this case an exit code of 513 means FxCop had an Analysis Error (0x01) and an…
Kiquenet
  • 14,494
  • 35
  • 148
  • 243
0
votes
1 answer

Sharing Code Analysis rules and dictionaries

We're moving to Visual Studio Professional 2012, and now have access to Code Analysis. Before, we used FxCop and passed a parameter of SourceControlPath\OurFxCopSharedProject.FxCop. We also added a CustomDictionary.xml to the (source controlled)…
TrueWill
  • 25,132
  • 10
  • 101
  • 150
0
votes
1 answer

assistance with fxcop

I am at present developing a mvc4 project that comunicates to a set of wcf services. I am setting such up in tfs build for a team of developers. I am very much a newbie to fxcop and code analysis in general. I am currently researching it and have…
amateur
  • 43,371
  • 65
  • 192
  • 320