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'm trying to create a REST API project using Slik.Cache, code example:
WebApplicationBuilderbuilder= WebApplication.CreateBuilder();
builder.Host.UseSlik(new SlikOptions
{Host=new IPEndPoint(IPAddress.Loopback,3092),Members=new[]{"localhost:3092","localhost:3093","localhost:3094"}});
builder.Services.AddControllers();// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();varapp= builder.Build();// Configure the HTTP request pipeline.if(app.Environment.IsDevelopment()){
app.UseSwagger();
app.UseSwaggerUI();}
app.UseAuthorization();
app.MapControllers();
app.Run();
But I get exception `System.NotSupportedException: 'ConfigureWebHost() is not supported by WebApplicationBuilder.Host. Use the WebApplication returned by WebApplicationBuilder.Build() instead.'.
Do I need to modify something to make it work?
The text was updated successfully, but these errors were encountered:
@harrison314 To support WebApplication properly, I need to rewrite the initialization (UseSlik extension method). As a workaround you can continue to use Generic Host in .NET 6. Please consult this article.
I'm trying to create a REST API project using Slik.Cache, code example:
But I get exception `System.NotSupportedException: 'ConfigureWebHost() is not supported by WebApplicationBuilder.Host. Use the WebApplication returned by WebApplicationBuilder.Build() instead.'.
Do I need to modify something to make it work?
The text was updated successfully, but these errors were encountered: