I have a DLL in .NET which uses a WebService (to send emails).
When I use the DLL in a project, it gives me an error unless I reference the webservice again.
I would like to not be forced to reference this in parent projects which use the DLL
To call the DLL, I simply do something like this:
Try
Dim x As New clsMail
Dim y As New clsMail.objMail
x.SendEmail(y)
Catch ex As Exception
e = ex.ToString
End Try
Is this possible since it is already referenced in the DLL?
If I remove the reference in the main project, I get an error from the Common DLL. If I add the Service reference to main project, then the error goes away.
I would like to be able to use this DLL and service by Only Importing the DLL without having to do any extra work. The point is to be able to import this DLL into many projects, without any extra steps in those projects.
Thanks in advance
Final Update:
Adding MailServer = New Mailserver.Service1SoapClient(New BasicHttpBinding(), New EndpointAddress("http://webmail/SendEmail.asmx") in the DLL itself Fixes this issue. I can now use in any project without having to reference the Web Service outside of the DLL
C# version:
MailServer.Service1SoapClient MailServer = new MailServer.Service1SoapClient(new BasicHttpBinding(), new EndpointAddress("http://webmail/SendEmail.asmx"));
Thank you