Hi.
I am having problems accessing methods in my WCF class library and am wondering if somebody could explain why?
I have a web project that has a single DLL file - WebAPILibrary.DLL in its /bin folder. The SVC files in my Web Site are pointing to the corresponding contracts contained in the DLL file. So, for example, under the namespace WebProject.WebAPI.Auth I have:
[DataContract]
public class Auth
{
[DataMember]
public string LoginUser;
}
[ServiceBehavior]
public class AuthService : IAuthService
{
string IAuthService.LoginUser(string Email, string Password)
{
//do some stuff
}
}
[ServiceContract(Namespace="WebAPI.Authentication")]
public interface IAuthService
{
[OperationContract(Name = "LoginUser")]
string LoginUser(string Email, string Password);
}
Now, when I instantiate AuthService auth = new AuthService() in my web project, I would expect auth.LoginUser(string Email, string Password) but auth does not expose any of my defined methods. As a test, I instantiated IAuthService and get what I want. Since IAuthService is implemented by AuthService, shouldn't I be able to do the same by instantiating AuthService?
Also, when i point to the URL of any of my SVC files, they load as expected.
Thanks for your time.