Consider the following situation which results in:
The type 'ConnectionStringSettingsCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Configuration, Version ...'.
Assembly A.dll:
// References System.Configuration
public class Foo
{
public Foo(int value)
{
// ...
}
// ConnectionStringSettingsCollection is defined in System.Configuration
public Foo(ConnectionStringSettingsCollection connString)
{
// ...
}
}
Assembly B.dll:
// References A.dll and _not_ System.Configuration
public class Bar
{
void SomeMethod()
{
var aFoo = new Foo(3); // Complains
}
}
The line var aFoo = new Foo(3);
complains with the error message mentioned above, which is clear and understandable.
However I don't understand, why I have to reference System.Configuration
in assembly B.dll
when the type isn't publicly exposing any property nor has any method which returns anything of that type.