-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ocelot IHostBuilder and IWebHostBuilder issues #1047
Comments
You can use Here is a sample that you can take a look. public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseUrls("http://*:9000")
.ConfigureAppConfiguration((hostingContext, config) =>
{
config
.SetBasePath(hostingContext.HostingEnvironment.ContentRootPath)
.AddJsonFile("ocelot.json")
.AddEnvironmentVariables();
config.AddOcelot("your folder", hostingContext.HostingEnvironment);
})
.ConfigureServices(services =>
{
services.AddOcelot();
})
.Configure(app =>
{
app.UseOcelot().Wait();
});
}); |
Thanks, you've saved my day. |
@gurelsoycaner Can we close the issue? |
raman-m
added
question
Initially seen a question could become a new feature or bug or closed ;)
waiting
Waiting for answer to question or feedback from issue raiser
labels
Sep 21, 2023
.NET Core 3 is not supportedOutdated issue ❗ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior / New Feature
Hi,
I'm having this issue after updating my system to .Net Core 3.0
I need to dynamically create ocelot.json base on my environment but I'm getting this error
"cannot convert from Microsoft.Extension.Hosting.IHostEnvironment to Microsoft.AspNetCore.Host.IWebHostEnvironment"
I find out that ocelot is still using IWebHostBuilder which is for .Net core 2.x instead of IHostBuilder that comes with .Net cor 3.0.
Thanks in advance
The text was updated successfully, but these errors were encountered: