Home > .net 3.5, Microsoft, Oracle, Visual Studio 2008 > Running Code Metrics with Oracle.DataAccess

Running Code Metrics with Oracle.DataAccess

April 10, 2008

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=2.0.0.0, 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.

It worked.

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?

*boggles*

%d bloggers like this: