我已经在IIS中托管了.net MVC应用程序。我正在尝试使用以下代码从控制台应用程序将IIS应用程序注册到Consul服务,
using Consul;
using System;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
try
{
var registration = new AgentServiceRegistration
{
Name = "ConsultationEngine",
Port = 8091,
Address = "127.0.0.1"
};
using (var client = new ConsulClient())
{
client.Agent.ServiceRegister(registration);
}
}
catch (Exception)
{
throw;
}
}
}
}
成功运行此代码服务后,未注册。 Consul是否仅支持Asp.net Core Applciation?