You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got the following exception when I'm starting the project:
DependencyResolutionException: None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Surging.Core.CPlatform.Runtime.Client.Implementation.RemoteInvokeService' can be invoked with the available services and parameters:
Cannot resolve parameter 'Surging.Core.CPlatform.Transport.ITransportClientFactory transportClientFactory' of constructor 'Void .ctor(Surging.Core.CPlatform.HashAlgorithms.IHashAlgorithm, Surging.Core.CPlatform.Runtime.Client.Address.Resolvers.IAddressResolver, Surging.Core.CPlatform.Transport.ITransportClientFactory, Microsoft.Extensions.Logging.ILogger`1[Surging.Core.CPlatform.Runtime.Client.Implementation.RemoteInvokeService], Surging.Core.CPlatform.Runtime.Client.HealthChecks.IHealthCheckService)'.
Program.cs - Main():
var consulConfigInfo = new ConfigInfo("127.0.0.1:8500");
var host = new ServiceHostBuilder()
.RegisterServices(builder =>
{
builder.AddMicroService(option =>
{
option.AddServiceRuntime();
option.AddRelateService();
option.AddConfigurationWatch();
// option.UseConsulManager(new ConfigInfo("127.0.0.1:8500"));
option.UseConsulRouteManager(consulConfigInfo);
option.UseConsulServiceSubscribeManager(consulConfigInfo);
option.UseConsulCommandManager(consulConfigInfo);
option.UseConsulCacheManager(consulConfigInfo);
option.UseConsulWatch(consulConfigInfo);
option.UseRabbitMQTransport();
option.AddRabbitMQAdapt();
builder.Register(p => new CPlatformContainer(ServiceLocator.Current));
});
})
.SubscribeAt()
.UseServer(options =>
{
options.Ip = "127.0.0.1";
options.Port = 98;
options.ExecutionTimeoutInMilliseconds = 30000; //执行超时时间
})
//.UseNLog(LogLevel.Error)// 使用NLog 记录日志
.Configure(builder => builder.AddEventBusFile("eventBusSettings.json", optional: false))
.UseProxy()
.UseStartup<Startup>()
.Build();
using (host.Run())
{
Console.WriteLine($"Service started successfully!, {DateTime.Now}");
}
Startup.cs
public class Startup : IStartup
{
public IContainer ConfigureServices(ContainerBuilder builder)
{
builder.RegisterType<WikiService>().As<IWikiService>();
ServiceLocator.Current = builder.Build();
return ServiceLocator.Current;
}
public void Configure(IContainer app)
{
}
}
The text was updated successfully, but these errors were encountered:
I got the following exception when I'm starting the project:
Program.cs - Main()
:Startup.cs
The text was updated successfully, but these errors were encountered: