Running Code Metrics with Oracle.DataAccess
I’m trying to get better at running the code metrics and being aware of how each of my assemblies stack up—a new feature in VS2008 and step for me (I’m used to using external tools and checking after the fact).
I came up with an odd bug today. One of my libraries references Oracle’s ODP.NET library: Oracle.DataAccess. Unfortunately, the code metrics snap-in threw a fit, or so I thought, at the Oracle library.
Here’s the relevant part of the error:
Message: An error occurred while calculating code metrics for target file ‘MyLibrary.dll‘ in project MyProject.
The following error was encountered while reading module ‘Oracle.DataAccess’: Security attribute type does not have a default constructor: System.Configuration.ConfigurationPermissionAttribute, System.Configuration, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
At first, second, and even third glance, I blamed Oracle (I enjoy blaming Oracle); however, after a bit of dinking, I took a wild shot and added System.Configuration into my project’s references.
Now, why in the heck does my project, that doesn’t use ANYTHING out of System.Configuration, require it to calculate code metrics?
Is it a dependency buried deep down in Oracle.DataAccess?