我有一个配置了Net.Tcp绑定的WCF自托管服务。此服务只需要侦听localhost端口,因此我的服务配置代码如下:
var endpointBaseAddressUri = new Uri(string.Format("net.tcp://localhost:{0}/{1}", availableTcpPort, parentID));
using (ServiceHost host = new ServiceHost(typeof(RenderOperation), new Uri[] { endpointBaseAddressUri }))
{
var binding = new NetTcpBinding();
binding.MaxReceivedMessageSize = MAXBUFFER;
binding.ReaderQuotas.MaxArrayLength = MAXBUFFER;
binding.ReaderQuotas.MaxStringContentLength = MAXBUFFER;
host.AddServiceEndpoint(typeof(IMyService), binding, guid);
host.Open();
// Other logic goes here
}
问题是,当使用管理员帐户启动服务时,一切顺利。但是,如果我使用常规帐户登录到Windows并启动此WCF服务,则会出现以下Windows防火墙对话框:
我的问题是:
谢谢!