Criei um chat com WCF, nas aplicações winform está rodando sem problemas, eu queria saber como eu conecto via web.
Quando tento conectar o erro que aparece é que o ambiente não está configurado para eventos.
public interface IChatChannel : IChatService, IClientChannel
{
}
channel = null;
this.UserName = user;
InstanceContext context = new InstanceContext(new Client(user));
factory = new DuplexChannelFactory<IChatChannel>(context, "ChatEndPoint");
channel = factory.CreateChannel();
IOnlineStatus status = channel.GetProperty<IOnlineStatus>();
status.Offline += new EventHandler(Offline);
status.Online += new EventHandler(Online);
channel.Open();
channel.Join(this.UserName);