我制作了一个基本的 wcf 控制台应用程序服务,它通过 pipe.net 进行通信。该逻辑适用于我的主应用程序,但出于业务原因我需要将其分开
它做其中之一
Uri baseAddress = new Uri(@"net.pipe://localhost/Server");
Uri baseHttpAddress = new Uri(@"http://localhost:9080");
using (var host = new ServiceHost(typeof(CPLConversionService), baseAddress, baseHttpAddress))
{
host.Open();
Console.WriteLine("The CPLConversionService is available. ");
Console.WriteLine("Press <Enter> to stop the service. ");
Console.ReadLine();
host.Close();
}
无论如何,可以将它放在网络服务器上并让它长期运行吗?我应该以某种形式使用 IIS 来管理它吗?