I have a Project which refers A.dll
and when I build that A.dll
is not copied locally as the Copy local is false. I also didn't use any method from A.dll
.
When i try to run FxCop on the Project, it complains that A.dll
is not available.
By any means can I avoid this checking in FxCop.
If you have Visual Studio installed on this machine, then you can also use
/p:RunCodeAnalysis=true
to have Fxcop automatically executed as part of the build. You can configure the rulesets for your projects from within Visual Studio as well. MsBuild will know whereA.dll
is located and will pass the correct references.As to why
A.dll
is needed, it's a bit dependent on your code, there clearly is a reference in the binary, so there is usage. It can be inheritance from a class or interface of that assembly, usage of an Enumeration or it may be an assembly that's used by another assembly, which you do invoke methods on directly.There is no way to suppress the warning generated if a Referenced assembly isn't found. The reason for this is that a number of rules (mostly the data flow rules) depend on these other assemblies to check whether Dispose is called on items, strings are passed to SQL statements unvalidated etc.
These types of rules would not be able to find all issues without being able to analyze the full code being executed.