You may be using types exposed by the web service, or it may be that you are having to add the web reference so that appropriate connection information is added to the config file. A winform application will not inherit or use a DLL's config file in any way unless you were to cook up some fancy loading mechanism for it. In other words, in the DLL when you add a web reference, it's config file gets information about how to connect to the web service, but when you then use the DLL in an application, your application needs that info in it's own config file, thus you must add a web reference so that the information is generated.
In regards to using a type exposed by the web reference, I'm not sure if this could be an issue you are experiencing. I have encountered this kind of thing in DLLs. For example, SharpMap.dll declares a SharpMapData
class, and WrapperOfSharpMap.dll has a method called ProcessData(SharpMapData blah)
If I write a WinForm application and add a reference to WrapperOfSharpMap.dll, I also have to add a reference to SharpMap.dll because to call ProcessData
I have to create a SharpMapData
instance to pass to the function. In other words, I am using a type declared in SharpMap.dll, therefore need a reference to it.
To resolve this problem, the creator of WrapperOfSharpMap.dll must create a WrapperSharpMapData
class like so:
class WrapperSharpMapData
{
private SharpMapData hiddenSharpMapData;
//create proprerties to access data elements using standard CLR types or other wrapper types
}