I have an odd web services problem.
I have a shared assembly (shared.dll) that is referenced both by a C#
WinForms client (client.exe) and a C# Web Service (service.dll). When I
upload the web service, naturally both service.dll and shared.dll are
uploaded to the bin folder.
In service.dll is defined a class called DataService that provides the web
service methods I need. To access this web service, client.exe uses code in
shared.dll to construct and use a DataService object. Therefore, the
following partial class is generated in Reference.cs for shared.dll:
public partial class DataService :
System.Web.Services.Protocols.SoapHttpClientProtoc ol
The problem occurs when I attempt to execute a method on the DataService
object from client.exe. It produces the following error:
The type 'MyNamespace.DataService' is ambiguous:
it could come from assembly '\bin\service.dll'
or from assembly '\bin\shared.dll'.
Please specify the assembly explicitly in the type name.
I can understand the ambiguity. There is the partial definition for
DataService that inherits from SoapHttpClientProtocol in shared.dll, and then
there's the full definition of DataService in service.dll.
The question is, how can I resolve this ambiguity? How do I explicitly tell
client.exe to use the full DataService definition in service.dll, and NOT the
partial definition in shared.dll?
Thank you.