I need to host a WCF service inside a Windows Forms application and call the WCF service from a Windows service that will send data to the WCF service which will show it in
I recomend you to also use a Thread:
private void Form1_Load(object sender, EventArgs e)
{
Task.Factory.StartNew(() =>
{
host = new ServiceHost(typeof(AssinadorWcf.AssinadorDigitalLecom));
host.Open();
});
}
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
try
{
host.Close();
}
catch
{
}
}